-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add specific error code to REST API #2443
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2443 +/- ##
============================================
+ Coverage 83.96% 84.19% +0.23%
- Complexity 1903 1916 +13
============================================
Files 246 251 +5
Lines 10714 10769 +55
Branches 769 764 -5
============================================
+ Hits 8996 9067 +71
+ Misses 1405 1397 -8
+ Partials 313 305 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
clients/client/src/main/java/org/projectnessie/client/rest/ResponseCheckFilter.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the separation for the not-found case.
Not sure about the added nessie-iae though.
model/src/main/java/org/projectnessie/error/NessieNotFoundException.java
Outdated
Show resolved
Hide resolved
model/src/main/java/org/projectnessie/error/NessieNotFoundException.java
Outdated
Show resolved
Hide resolved
model/src/main/java/org/projectnessie/error/NessieReferenceConflictException.java
Outdated
Show resolved
Hide resolved
servers/services/src/main/java/org/projectnessie/services/impl/ContentsApiImpl.java
Outdated
Show resolved
Hide resolved
model/src/main/java/org/projectnessie/error/NessieContentsNotFoundException.java
Outdated
Show resolved
Hide resolved
servers/jax-rs-tests/src/main/java/org/projectnessie/jaxrs/AbstractTestRest.java
Show resolved
Hide resolved
model/src/main/java/org/projectnessie/error/NessieIllegalArgumentException.java
Outdated
Show resolved
Hide resolved
@snazy : do we want this in |
* Add `errorCode` to the `NessieError` object, whose JSON representation is set to clients as HTTP error response payload. This is necessary to allow clients to distinguish Nessie-specific failure mode that fall under the same HTTP status code. * Note: this will break Nessie error response handling in older java clients. * Add more specific exception classes to `nessie-model` * Update java client to unwrap and throw (more) specific exceptions based on `NessieError` payload error codes. * Corresponding Python client changes to follow in a separate commit. * Fix a `TreeApiImpl.meta()` to throw a NessieIllegalArgumentException instead of NessieConflictException when the committer is set by the user. * Refactor `toHash()` in `TreeApiImpl` to remove unnecessary `Optional` * Minor code cleanup in `AbstractTestRest` Closes projectnessie#477
8585680
to
521e53e
Compare
Add
errorCode
to theNessieError
object, whose JSON representationis set to clients as HTTP error response payload. This is necessary to
allow clients to distinguish Nessie-specific failure mode that fall
under the same HTTP status code.
Note: this will break Nessie error response handling in older java clients.
Add more specific exception classes to
nessie-model
Update java client to unwrap and throw (more) specific exceptions based
on
NessieError
payload error codes.Corresponding Python client changes to follow in a separate commit.
Fix a
TreeApiImpl.meta()
to throw a NessieIllegalArgumentExceptioninstead of NessieConflictException when the committer is set by the user.
Refactor
toHash()
inTreeApiImpl
to remove unnecessaryOptional
Minor code cleanup in
AbstractTestRest
Closes #477
Non-trivial changes are in
ErrorCode
,NessieError
,ResponseCheckFilter
,TreeApiImpl
(and other ApiImpl classes). The rest of changes is just the ripple effect of the former.