Class MongoDbErrorCodes
java.lang.Object
org.springframework.data.mongodb.util.MongoDbErrorCodes
MongoDbErrorCodes
holds MongoDB specific error codes outlined in mongo/base/error_codes.yml.- Since:
- 1.8
- Author:
- Christoph Strobl, Mark Paluch, SangHyuk Lee
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getErrorDescription
(Integer errorCode) static boolean
isClientSessionFailure
(Exception exception) static boolean
isClientSessionFailureCode
(Integer errorCode) Check if the given error code matches a know session related error.static boolean
isDataAccessResourceError
(Exception exception) static boolean
isDataAccessResourceFailureCode
(Integer errorCode) static boolean
isDataDuplicateKeyError
(Exception exception) static boolean
isDataIntegrityViolationCode
(Integer errorCode) static boolean
isDataIntegrityViolationError
(Exception exception) static boolean
isDuplicateKeyCode
(Integer errorCode) static boolean
isDuplicateKeyError
(Exception exception) static boolean
isInvalidDataAccessApiUsageCode
(Integer errorCode) static boolean
isInvalidDataAccessApiUsageError
(Exception exception) static boolean
isPermissionDeniedCode
(Integer errorCode) static boolean
isPermissionDeniedError
(Exception exception) static boolean
isTransactionFailureCode
(Integer errorCode) Check if the given error code matches a know transaction related error.
-
Constructor Details
-
MongoDbErrorCodes
public MongoDbErrorCodes()
-
-
Method Details
-
getErrorDescription
-
isDataIntegrityViolationCode
-
isDataIntegrityViolationError
- Parameters:
exception
- can be null.- Returns:
- Since:
- 4.4
-
isDataAccessResourceFailureCode
-
isDataAccessResourceError
- Parameters:
exception
- can be null.- Returns:
- Since:
- 4.4
-
isDuplicateKeyCode
-
isDuplicateKeyError
- Parameters:
exception
- can be null.- Returns:
- Since:
- 4.4
-
isDataDuplicateKeyError
- Parameters:
exception
- can be null.- Returns:
- Since:
- 4.4
-
isPermissionDeniedCode
-
isPermissionDeniedError
- Parameters:
exception
- can be null.- Returns:
- Since:
- 4.4
-
isInvalidDataAccessApiUsageCode
-
isInvalidDataAccessApiUsageError
- Parameters:
exception
- can be null.- Returns:
- Since:
- 4.4
-
isClientSessionFailureCode
Check if the given error code matches a know session related error.- Parameters:
errorCode
- the error code to check.- Returns:
- true if error matches.
- Since:
- 2.1
-
isTransactionFailureCode
Check if the given error code matches a know transaction related error.- Parameters:
errorCode
- the error code to check.- Returns:
- true if error matches.
- Since:
- 2.1
-
isClientSessionFailure
- Parameters:
exception
- can be null.- Returns:
- Since:
- 4.4
-