Package org.bson

Class BSONException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BsonInvalidOperationException, BsonSerializationException

public class BSONException extends RuntimeException
A general runtime exception raised in BSON processing.
  • Constructor Details

    • 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 Details

    • getErrorCode

      public Integer getErrorCode()
      Returns the error code.
      Returns:
      The error code.
    • hasErrorCode

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