Class MongoException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.codename1.backend.mongo.MongoException
A command MongoDB answered with ok: 0, or a write it reported failed.
getCode() is MongoDB's numeric error code (11000 for a duplicate key) and
getCodeName() its name, when the server sent one.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe code of a unique index violation. -
Constructor Summary
ConstructorsConstructorDescriptionMongoException(int code, String codeName, String message) A failure with a server code, its name (or null) and the message. -
Method Summary
Modifier and TypeMethodDescriptionintgetCode()MongoDB's error code, or 0 when it sent none.The name of the code, such asDuplicateKey, or null.booleanWhether this failure is a unique index violation.Methods inherited from class Throwable
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
DUPLICATE_KEY
public static final int DUPLICATE_KEYThe code of a unique index violation.- See Also:
-
-
Constructor Details
-
MongoException
-
-
Method Details
-
getCode
public int getCode()MongoDB's error code, or 0 when it sent none. -
getCodeName
The name of the code, such asDuplicateKey, or null. -
isDuplicateKey
public boolean isDuplicateKey()Whether this failure is a unique index violation.
-