-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Refine exception translation for client session exceptions #605
Conversation
b94c3ca
to
ea8e83b
Compare
7f55001
to
9d74734
Compare
ba45392
to
7e7c37d
Compare
…tions. We now distinguish between Transient and NonTransient failures by checking the Error labels of an Error and create the according DataAccessException based on that information. These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended. * [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to: https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200). * [ ] http://www.apache.org/licenses/LICENSE-2.0 with 852 occurrences migrated to: https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200). Original Pull Request: #721
7e7c37d
to
459dba9
Compare
Spring's DAO exceptions do not differentiate between contextual transience in the sense that MongoDB does. Re-wrapping exceptions to add another transient flavour isn't appropriate. We also do not have a way to add this flavor to exceptions that we use such as I updated the PR to allow the configuration of a |
459dba9
to
31fe900
Compare
if (MongoDbErrorCodes.isDataIntegrityViolationError(mongoException)) { | ||
return new DataIntegrityViolationException(mongoException.getMessage(), mongoException); | ||
} | ||
if (MongoDbErrorCodes.isClientSessionFailure(mongoException)) { |
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.
same as in line 143?
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.
the DataIntegrityViolation
block is duplicated as well, seems a remainder from conflict resolution. Both if
branches can go away.
We now distinguish between
Transient
andNonTransient
failures by checking the Error labels of an Error and create the accordingDataAccessException
based on that information.