Class BKException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.bookkeeper.client.api.BKException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BKException

@Public @Unstable public class BKException extends Exception
Super class for all errors which occur using BookKeeper client.
Since:
4.6
See Also:
  • Field Details

  • Constructor Details

    • BKException

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

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

    • getCode

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

      public static 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 String getMessage(int code)
      Describe an error code.
      Parameters:
      code - the error code value
      Returns:
      the description of the error code