Class BKException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    BKException

    @Public
    @Unstable
    public class BKException
    extends java.lang.Exception
    Super class for all errors which occur using BookKeeper client.
    Since:
    4.6
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  BKException.Code
      Codes which represent the various exception types.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int code  
      (package private) static java.util.function.Function<java.lang.Throwable,​BKException> HANDLER  
    • Constructor Summary

      Constructors 
      Constructor Description
      BKException​(int code)
      Create a new exception.
      BKException​(int code, java.lang.Throwable cause)
      Create a new exception with the cause.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object codeLogger​(int code)
      Returns a lazy error code formatter suitable to pass to log functions.
      int getCode()
      Get the return code for the exception.
      static java.lang.String getMessage​(int code)
      Describe an error code.
      • 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

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • HANDLER

        static final java.util.function.Function<java.lang.Throwable,​BKException> HANDLER
      • code

        protected final int code
    • Constructor Detail

      • BKException

        public BKException​(int code)
        Create a new exception.
        Parameters:
        code - the error code
        See Also:
        BKException.Code
      • BKException

        public BKException​(int code,
                           java.lang.Throwable cause)
        Create a new exception with the cause.
        Parameters:
        code - exception code
        cause - the exception cause
    • Method Detail

      • getCode

        public final int getCode()
        Get the return code for the exception.
        Returns:
        the error code
        See Also:
        BKException.Code
      • codeLogger

        public static java.lang.Object codeLogger​(int code)
        Returns a lazy error code formatter suitable to pass to log functions.
        Parameters:
        code - the error code value
        Returns:
        lazy error code log formatter
      • getMessage

        public static java.lang.String getMessage​(int code)
        Describe an error code.
        Parameters:
        code - the error code value
        Returns:
        the description of the error code