public class MongoException
extends java.lang.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,
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
|
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 causepublic MongoException(BSONObject o)
o -