Package org.apache.bookkeeper.client.api
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
Super class for all errors which occur using BookKeeper client.
- Since:
- 4.6
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCodes which represent the various exception types. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final int(package private) static final Function<Throwable,BKException> -
Constructor Summary
ConstructorsConstructorDescriptionBKException(int code) Create a new exception.BKException(int code, Throwable cause) Create a new exception with the cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectcodeLogger(int code) Returns a lazy error code formatter suitable to pass to log functions.final intgetCode()Get the return code for the exception.static StringgetMessage(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
-
Field Details
-
HANDLER
-
code
protected final int code
-
-
Constructor Details
-
BKException
public BKException(int code) Create a new exception.- Parameters:
code- the error code- See Also:
-
BKException
Create a new exception with the cause.- Parameters:
code- exception codecause- the exception cause
-
-
Method Details
-
getCode
public final int getCode()Get the return code for the exception.- Returns:
- the error code
- See Also:
-
codeLogger
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
Describe an error code.- Parameters:
code- the error code value- Returns:
- the description of the error code
-