org.bson
Class BSONException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.bson.BSONException
All Implemented Interfaces:
Serializable

public class BSONException
extends RuntimeException

A general runtime exception raised in BSON processing.

See Also:
Serialized Form

Constructor Summary
BSONException(int errorCode, String msg)
           
BSONException(int errorCode, String msg, Throwable t)
           
BSONException(String msg)
           
BSONException(String msg, Throwable t)
           
 
Method Summary
 Integer getErrorCode()
          Returns the error code.
 boolean hasErrorCode()
          Returns true if the error code is set (i.e., not null).
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BSONException

public BSONException(String msg)
Parameters:
msg - The error message.

BSONException

public BSONException(int errorCode,
                     String msg)
Parameters:
errorCode - The error code.
msg - The error message.

BSONException

public BSONException(String msg,
                     Throwable t)
Parameters:
msg - The error message.
t - The throwable cause.

BSONException

public BSONException(int errorCode,
                     String msg,
                     Throwable t)
Parameters:
errorCode - The error code.
msg - The error message.
t - The throwable cause.
Method Detail

getErrorCode

public Integer getErrorCode()
Returns the error code.

Returns:
The error code.

hasErrorCode

public boolean hasErrorCode()
Returns true if the error code is set (i.e., not null).