public class MongoException
extends java.lang.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. |
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
_code |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
MongoException(BSONObject o)
Deprecated.
Use one of the other available constructors instead
|
MongoException(int code,
java.lang.String msg) |
MongoException(int code,
java.lang.String msg,
java.lang.Throwable t) |
MongoException(java.lang.String msg) |
MongoException(java.lang.String msg,
java.lang.Throwable t) |
| Modifier and Type | Method and Description |
|---|---|
int |
getCode()
Gets the exception code
|
(package private) static MongoException |
parse(BSONObject o) |
private static final long serialVersionUID
final int _code
public MongoException(java.lang.String msg)
msg - the messagepublic MongoException(int code,
java.lang.String msg)
code - the error codemsg - the messagepublic MongoException(java.lang.String msg,
java.lang.Throwable t)
msg - the messaget - the throwable causepublic MongoException(int code,
java.lang.String msg,
java.lang.Throwable t)
code - the error codemsg - the messaget - the throwable cause@Deprecated public MongoException(BSONObject o)
o - the document from the server containing the errorstatic MongoException parse(BSONObject o)
public int getCode()