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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable String
getErrorDescription
(@Nullable Integer errorCode) static boolean
isClientSessionFailure
(Exception exception) static boolean
isClientSessionFailureCode
(@Nullable Integer errorCode) Check if the given error code matches a know session related error.static boolean
isDataAccessResourceError
(Exception exception) static boolean
isDataAccessResourceFailureCode
(@Nullable Integer errorCode) static boolean
isDataDuplicateKeyError
(Exception exception) static boolean
isDataIntegrityViolationCode
(@Nullable Integer errorCode) static boolean
isDataIntegrityViolationError
(Exception exception) static boolean
isDuplicateKeyCode
(@Nullable Integer errorCode) static boolean
isDuplicateKeyError
(Exception exception) static boolean
isInvalidDataAccessApiUsageCode
(@Nullable Integer errorCode) static boolean
isInvalidDataAccessApiUsageError
(Exception exception) static boolean
isPermissionDeniedCode
(@Nullable Integer errorCode) static boolean
isPermissionDeniedError
(Exception exception) static boolean
isTransactionFailureCode
(@Nullable 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
-