com.mongodb
Class MongoException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.mongodb.MongoException
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- CommandFailureException, MongoException.CursorNotFound, MongoException.Network, MongoInternalException, MongoInterruptedException, WriteConcernException
public class MongoException
- extends RuntimeException
A general exception raised in Mongo
- Author:
- antoine
- See Also:
- Serialized Form
Method Summary |
int |
getCode()
Gets the exception code |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
MongoException
public MongoException(String msg)
- Parameters:
msg
- the message
MongoException
public MongoException(int code,
String msg)
- Parameters:
code
- the error codemsg
- the message
MongoException
public MongoException(String msg,
Throwable t)
- Parameters:
msg
- the messaget
- the throwable cause
MongoException
public MongoException(int code,
String msg,
Throwable t)
- Parameters:
code
- the error codemsg
- the messaget
- the throwable cause
MongoException
public MongoException(BSONObject o)
- Creates a MongoException from a BSON object representing an error
- Parameters:
o
-
getCode
public int getCode()
- Gets the exception code
- Returns: