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 StringgetErrorDescription(@Nullable Integer errorCode) static booleanisClientSessionFailure(Exception exception) static booleanisClientSessionFailureCode(@Nullable Integer errorCode) Check if the given error code matches a know session related error.static booleanisDataAccessResourceError(Exception exception) static booleanisDataAccessResourceFailureCode(@Nullable Integer errorCode) static booleanisDataDuplicateKeyError(Exception exception) static booleanisDataIntegrityViolationCode(@Nullable Integer errorCode) static booleanisDataIntegrityViolationError(Exception exception) static booleanisDuplicateKeyCode(@Nullable Integer errorCode) static booleanisDuplicateKeyError(Exception exception) static booleanisInvalidDataAccessApiUsageCode(@Nullable Integer errorCode) static booleanisInvalidDataAccessApiUsageError(Exception exception) static booleanisPermissionDeniedCode(@Nullable Integer errorCode) static booleanisPermissionDeniedError(Exception exception) static booleanisTransactionFailureCode(@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
-