BSONException
Date: 2015-03-03

org.bson

## Class BSONException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.bson.BSONException

- All Implemented Interfaces:
    java.io.Serializable

      public class BSONException
      extends java.lang.RuntimeException

  A general runtime exception raised in BSON processing.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BSONException(int errorCode, java.lang.String msg)`
    `BSONException(int errorCode, java.lang.String msg, java.lang.Throwable t)`
    `BSONException(java.lang.String msg)`
    `BSONException(java.lang.String msg, java.lang.Throwable t)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BSONException

          public BSONException(java.lang.String msg)

      Parameters:
        `msg` - The error message.

    - #### BSONException

          public BSONException(int errorCode,
                       java.lang.String msg)

      Parameters:
        `errorCode` - The error code.
        `msg` - The error message.

    - #### BSONException

          public BSONException(java.lang.String msg,
                       java.lang.Throwable t)

      Parameters:
        `msg` - The error message.
        `t` - The throwable cause.

    - #### BSONException

          public BSONException(int errorCode,
                       java.lang.String msg,
                       java.lang.Throwable t)

      Parameters:
        `errorCode` - The error code.
        `msg` - The error message.
        `t` - The throwable cause.

  - ### Method Detail

    - #### getErrorCode

          public java.lang.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).