-
Notifications
You must be signed in to change notification settings - Fork 251
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
feat: separate unexpected from expected exceptions #1744
feat: separate unexpected from expected exceptions #1744
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1744 +/- ##
==========================================
+ Coverage 67.33% 67.37% +0.03%
==========================================
Files 785 781 -4
Lines 16858 16749 -109
Branches 1061 1056 -5
==========================================
- Hits 11352 11284 -68
+ Misses 5050 5007 -43
- Partials 456 458 +2
Continue to review full report at Codecov.
|
...ipse/dataspaceconnector/api/datamanagement/transferprocess/TransferProcessApiController.java
Fixed
Show fixed
Hide fixed
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.
comments inline
...aceconnector/api/datamanagement/contractnegotiation/model/NegotiationInitiateRequestDto.java
Outdated
Show resolved
Hide resolved
...aceconnector/api/datamanagement/contractnegotiation/model/NegotiationInitiateRequestDto.java
Outdated
Show resolved
Hide resolved
...n/java/org/eclipse/dataspaceconnector/extension/jersey/mapper/UnexpectedExceptionMapper.java
Outdated
Show resolved
Hide resolved
.../jersey/src/main/java/org/eclipse/dataspaceconnector/extension/jersey/JerseyRestService.java
Show resolved
Hide resolved
.../dataspaceconnector/transfer/provision/http/webhook/HttpProvisionerWebhookApiController.java
Show resolved
Hide resolved
...rc/main/java/org/eclipse/dataspaceconnector/api/datamanagement/asset/AssetApiController.java
Outdated
Show resolved
Hide resolved
…ssages through the EdcApiException
* api: separate unexpected from expected exceptions * Fix tests * PR remark * Simplify validation * Improve Result to List<ApiErrorDetail> mapping by carrying failure messages through the EdcApiException
What this PR changes/adds
Distinct between expected (subclasses of
EdcApiException
) from unexpected (any other) exceptions.The latter, as unexpected, will return a 5xx error, by default a 500 Internal Server Error, as it's a generic "server failure" error.
Why it does that
To improve error handling.
Further notes
InvalidRequestException
that replaces all theIllegalArgumentException
in thedata-management
api modulesEdcApiExceptionMapper
,ValidationExceptionMapper
andUnexpectedExceptionMapper
Linked Issue(s)
Closes #1730
Checklist
no-changelog
)