Package org.apache.zookeeper
Class KeeperException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.zookeeper.KeeperException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
KeeperException.APIErrorException,KeeperException.AuthFailedException,KeeperException.BadArgumentsException,KeeperException.BadVersionException,KeeperException.ConnectionLossException,KeeperException.DataInconsistencyException,KeeperException.EphemeralOnLocalSessionException,KeeperException.InvalidACLException,KeeperException.InvalidCallbackException,KeeperException.MarshallingErrorException,KeeperException.NewConfigNoQuorum,KeeperException.NoAuthException,KeeperException.NoChildrenForEphemeralsException,KeeperException.NodeExistsException,KeeperException.NoNodeException,KeeperException.NotEmptyException,KeeperException.NotReadOnlyException,KeeperException.NoWatcherException,KeeperException.OperationTimeoutException,KeeperException.QuotaExceededException,KeeperException.ReconfigDisabledException,KeeperException.ReconfigInProgress,KeeperException.RequestTimeoutException,KeeperException.RuntimeInconsistencyException,KeeperException.SessionClosedRequireAuthException,KeeperException.SessionExpiredException,KeeperException.SessionMovedException,KeeperException.SystemErrorException,KeeperException.ThrottledOpException,KeeperException.UnimplementedException,KeeperException.UnknownSessionException
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic enumCodes which represent the various KeeperException types.static interfaceDeprecated.static classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncode()Read the error Code for this exceptionstatic KeeperExceptioncreate(int code) Deprecated.static KeeperExceptionDeprecated.deprecated in 3.1.0, usecreate(Code, String)insteadstatic KeeperExceptioncreate(KeeperException.Code code) All non-specific keeper exceptions should be constructed via this factory method in order to guarantee consistency in error codes and such.static KeeperExceptioncreate(KeeperException.Code code, String path) All non-specific keeper exceptions should be constructed via this factory method in order to guarantee consistency in error codes and such.intgetCode()Deprecated.deprecated in 3.1.0, usecode()insteadgetPath()Read the path for this exceptionIf this exception was thrown by a multi-request then the (partial) results and error codes can be retrieved using this getter.voidsetCode(int code) Deprecated.deprecated in 3.1.0, exceptions should be immutable, this method should not be usedMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
KeeperException
-
-
Method Details
-
create
All non-specific keeper exceptions should be constructed via this factory method in order to guarantee consistency in error codes and such. If you know the error code, then you should construct the special purpose exception directly. That will allow you to have the most specific possible declarations of what exceptions might actually be thrown.- Parameters:
code- The error code.path- The ZooKeeper path being operated on.- Returns:
- The specialized exception, presumably to be thrown by the caller.
-
create
Deprecated.deprecated in 3.1.0, usecreate(Code, String)instead -
create
Deprecated.deprecated in 3.1.0, usecreate(Code)instead -
create
All non-specific keeper exceptions should be constructed via this factory method in order to guarantee consistency in error codes and such. If you know the error code, then you should construct the special purpose exception directly. That will allow you to have the most specific possible declarations of what exceptions might actually be thrown.- Parameters:
code- The error code of your new exception. This will also determine the specific type of the exception that is returned.- Returns:
- The specialized exception, presumably to be thrown by the caller.
-
setCode
Deprecated.deprecated in 3.1.0, exceptions should be immutable, this method should not be usedSet the code for this exception- Parameters:
code- error code
-
getCode
Deprecated.deprecated in 3.1.0, usecode()insteadRead the error code for this exception- Returns:
- the error code for this exception
-
code
Read the error Code for this exception- Returns:
- the error Code for this exception
-
getPath
Read the path for this exception- Returns:
- the path associated with this error, null if none
-
getMessage
- Overrides:
getMessagein classThrowable
-
getResults
If this exception was thrown by a multi-request then the (partial) results and error codes can be retrieved using this getter.- Returns:
- A copy of the list of results from the operations in the multi-request.
- Since:
- 3.4.0
-
create(Code)instead