public class MongoException extends RuntimeException
Modifier and Type | Class and Description |
---|---|
static class |
MongoException.CursorNotFound
Subclass of MongoException representing a cursor-not-found exception
|
static class |
MongoException.DuplicateKey
Subclass of WriteConcernException representing a duplicate key error
|
static class |
MongoException.Network
Subclass of MongoException representing a network-related exception
|
Constructor and Description |
---|
MongoException(BSONObject o)
Creates a MongoException from a BSON object representing an error
|
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 causepublic MongoException(BSONObject o)
o
-