Package com.mongodb
Enum Class ErrorCategory
- All Implemented Interfaces:
Serializable
,Comparable<ErrorCategory>
,java.lang.constant.Constable
A categorization of errors returned by a MongoDB server command.
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA duplicate key errorAn execution timeout errorAn uncategorized error -
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorCategory
fromErrorCode
(int code) Translate an error code into an error categorystatic ErrorCategory
Returns the enum constant of this class with the specified name.static ErrorCategory[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNCATEGORIZED
An uncategorized error -
DUPLICATE_KEY
A duplicate key error- MongoDB documentation
- Unique Indexes
-
EXECUTION_TIMEOUT
An execution timeout error- MongoDB documentation
- maxTimeMS
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromErrorCode
Translate an error code into an error category- Parameters:
code
- the error code- Returns:
- the error category for the given code
-