SerializableMongoChangeStreamException, MongoClientException, MongoExecutionTimeoutException, MongoGridFSException, MongoIncompatibleDriverException, MongoInternalException, MongoInterruptedException, MongoServerException, MongoSocketExceptionpublic class MongoException extends RuntimeException
| Constructor | Description |
|---|---|
MongoException(int code,
String msg) |
|
MongoException(int code,
String msg,
Throwable t) |
|
MongoException(String msg) |
|
MongoException(String msg,
Throwable t) |
| Modifier and Type | Method | Description |
|---|---|---|
static MongoException |
fromThrowable(Throwable t) |
Static helper to create or cast a MongoException from a throwable
|
static MongoException |
fromThrowableNonNull(Throwable t) |
Static helper to create or cast a MongoException from a throwable
|
int |
getCode() |
Gets the exception code
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic MongoException(String msg)
msg - the messagepublic MongoException(int code,
String msg)
code - the error codemsg - the messagepublic MongoException(String msg, Throwable t)
msg - the messaget - the throwable cause@Nullable public static MongoException fromThrowable(@Nullable Throwable t)
t - a throwable, which may be nullpublic static MongoException fromThrowableNonNull(Throwable t)
t - a throwable, which may not be nullpublic int getCode()