public class MongoException
extends java.lang.RuntimeException
Modifier and Type | Field and Description |
---|---|
private int |
code |
private static long |
serialVersionUID |
Constructor and Description |
---|
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 |
---|---|
static MongoException |
fromThrowable(java.lang.Throwable t)
Static helper to create or cast a MongoException from a throwable
|
int |
getCode()
Gets the exception code
|
private static final long serialVersionUID
private 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 causepublic static MongoException fromThrowable(java.lang.Throwable t)
t
- a throwablepublic int getCode()