public class MongoException extends RuntimeException
Modifier and Type | Class and Description |
---|---|
static class |
MongoException.CursorNotFound
Deprecated.
This class will be dropped in 3.x versions.
Please catch
MongoCursorNotFoundException instead. |
static class |
MongoException.DuplicateKey
Deprecated.
This class will be dropped in 3.x versions.
Please catch
DuplicateKeyException instead. |
static class |
MongoException.Network
Deprecated.
This class will be dropped in 3.x versions.
Please catch
MongoSocketException instead. |
Constructor and Description |
---|
MongoException(BSONObject o)
Deprecated.
Use one of the other available constructors instead
|
MongoException(int code,
String msg) |
MongoException(int code,
String msg,
Throwable t) |
MongoException(String msg) |
MongoException(String msg,
Throwable t) |
Modifier and Type | Method and Description |
---|---|
int |
getCode()
Gets the exception code
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public 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 causepublic MongoException(int code, String msg, Throwable t)
code
- the error codemsg
- the messaget
- the throwable cause@Deprecated public MongoException(BSONObject o)
o
- the document from the server containing the error