org.springframework.data.mongodb.util

Class MongoDbErrorCodes



  • public final class MongoDbErrorCodes
    extends Object
    MongoDbErrorCodes holds MongoDB specific error codes outlined in mongo/base/error_codes.err.
    Since:
    1.8
    Author:
    Christoph Strobl, Mark Paluch
    • Constructor Detail

      • MongoDbErrorCodes

        public MongoDbErrorCodes()
    • Method Detail

      • isDataIntegrityViolationCode

        public static boolean isDataIntegrityViolationCode(@Nullable
                                                           Integer errorCode)
      • isDataAccessResourceFailureCode

        public static boolean isDataAccessResourceFailureCode(@Nullable
                                                              Integer errorCode)
      • isDuplicateKeyCode

        public static boolean isDuplicateKeyCode(@Nullable
                                                 Integer errorCode)
      • isPermissionDeniedCode

        public static boolean isPermissionDeniedCode(@Nullable
                                                     Integer errorCode)
      • isInvalidDataAccessApiUsageCode

        public static boolean isInvalidDataAccessApiUsageCode(@Nullable
                                                              Integer errorCode)
      • isClientSessionFailureCode

        public static boolean isClientSessionFailureCode(@Nullable
                                                         Integer errorCode)
        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

        public static boolean isTransactionFailureCode(@Nullable
                                                       Integer errorCode)
        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