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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringgetErrorDescription(Integer errorCode) static booleanisClientSessionFailure(Exception exception) static booleanisClientSessionFailureCode(Integer errorCode) Check if the given error code matches a know session related error.static booleanisDataAccessResourceError(Exception exception) static booleanisDataAccessResourceFailureCode(Integer errorCode) static booleanisDataDuplicateKeyError(Exception exception) static booleanisDataIntegrityViolationCode(Integer errorCode) static booleanisDataIntegrityViolationError(Exception exception) static booleanisDuplicateKeyCode(Integer errorCode) static booleanisDuplicateKeyError(Exception exception) static booleanisInvalidDataAccessApiUsageCode(Integer errorCode) static booleanisInvalidDataAccessApiUsageError(Exception exception) static booleanisPermissionDeniedCode(Integer errorCode) static booleanisPermissionDeniedError(Exception exception) static booleanisTransactionFailureCode(Integer errorCode) Check if the given error code matches a know transaction related error.
- 
Constructor Details- 
MongoDbErrorCodespublic 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
 
- 
isClientSessionFailureCodeCheck 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
 
- 
isTransactionFailureCodeCheck 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
 
 
-