-
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
MongoSocketWriteException may be translated into DataAccessResourceFailureException #3568
Labels
status: ideal-for-contribution
An issue that a contributor can help us with
type: enhancement
A general enhancement
Milestone
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
Feb 24, 2021
|
mp911de
added
status: ideal-for-contribution
An issue that a contributor can help us with
type: enhancement
A general enhancement
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Feb 25, 2021
boly38
added a commit
to boly38/spring-data-mongodb
that referenced
this issue
Feb 25, 2021
boly38
added a commit
to boly38/spring-data-mongodb
that referenced
this issue
Mar 1, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
status: ideal-for-contribution
An issue that a contributor can help us with
type: enhancement
A general enhancement
Hi
What
This is a user feedback about spring data mongodb exception translation:
MongoSocketWriteException
during a simplefindBy...()
org.springframework.data.mongodb.UncategorizedMongoDbException
Here is an extract of the stack:
MongoSocketException
and other "resource-related" exceptions in the same way but the translator didn't translateMongoSocketWriteException
case intoDataAccessResourceFailureException
so we can't without checking on our side this kind of mongo exceptions..Version
We're using spring-data-mongodb
3.0.6.RELEASE
but I saw that the relate code dont change.
List of resource-related exception:
spring-data-mongodb/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoExceptionTranslator.java
Lines 58 to 60 in ad6d2c9
Why
Today I think the translator translates only an exact match between user-exception and
RESOURCE_FAILURE_EXCEPTIONS
translation matrix entries.spring-data-mongodb/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoExceptionTranslator.java
Line 87 in ad6d2c9
HowToReproduce
Fix Suggest
There is no check on user-exception ancestor.
For example, I expect
MongoSocketWriteException
(child ofMongoSocketException
) like all otherMongoSocketException
childs to be translated intoDataAccessResourceFailureException
.Am I wrong?
If I'm right, do you plan to improve
MongoExceptionTranslator
this way ?Regards
The text was updated successfully, but these errors were encountered: