Skip to content

server: add global HTTP error handling (2/N) - #20

Closed
littlegrasscao wants to merge 42 commits into
OpenSharing-IO:mainfrom
littlegrasscao:server/03-config-errors
Closed

littlegrasscao wants to merge 42 commits into
OpenSharing-IO:mainfrom
littlegrasscao:server/03-config-errors

Conversation

@littlegrasscao

@littlegrasscao littlegrasscao commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part 2/N.

Adds GlobalExceptionHandler — a @RestControllerAdvice that maps controller-layer failures to the protocol {errorCode, message} JSON shape:

  • ApiException (domain errors from stores and controllers)
  • Validation, malformed JSON, JPA uniqueness conflicts
  • Unknown routes and unexpected errors (sanitized)

Catalog-specific exception types and their HTTP mapping arrive with the catalog connector PR.

Test plan

  • cd server && mvn test

Sun Cao added 30 commits August 26, 2026 17:20
Give the repo a GitHub Actions workflow so PRs and main are checked automatically, running the server suite when that module is present.
Match the reference server's coordinates and Java 21 / Spring Boot 3.5.3 from the draft implementation PR, with a context-load test, so pull-request CI exercises mvn verify instead of skipping.
Drop the skip path now that server/ is in the tree, pin the runner to ubuntu-24.04, and pin checkout, setup-java, and upload-artifact to the same commit SHAs Delta Sharing uses.
OpenSharing feature keys arrive in later PRs as each area lands.
Sun Cao added 12 commits September 1, 2026 14:02
Catalog exception types and GlobalExceptionHandler only; OpenSharing
configuration properties arrive with the features that need them.
Drop the server() sentinel and isServer(); access-denied messages
always name the caller.
Replace the two thin subclasses with CatalogException.Kind and static
factories; GlobalExceptionHandler maps each kind to the same responses
as before.
Keep CatalogException subclasses for each failure shape, but fold
access denied and catalog authentication into CatalogAuthorizationException
instead of two parallel types.
CatalogAuthorizationException no longer distinguishes reason; both map to
403 PERMISSION_DENIED with the exception message.
Catalog-specific exception types and their HTTP mapping belong with the
catalog connector PR, where connector code translates native catalog
failures into sharing-server exceptions.
@littlegrasscao littlegrasscao changed the title server: add global HTTP error handling (3/N) server: add global HTTP error handling (2/N) Sep 1, 2026
@littlegrasscao

Copy link
Copy Markdown
Collaborator Author

Closing as superseded: this split was cut against the reference server as it existed on 2026-09-01, before the module split (opensharing-server-core/opensharing-server), Unity Catalog integration, embedding, and the current auth model. #14 has moved well past this. Restarting the split against #14's current state instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant