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.InvalidACLException, KeeperException.InvalidCallbackException, KeeperException.MarshallingErrorException, KeeperException.NoAuthException, KeeperException.NoChildrenForEphemeralsException, KeeperException.NodeExistsException, KeeperException.NoNodeException, KeeperException.NotEmptyException, KeeperException.OperationTimeoutException, KeeperException.RuntimeInconsistencyException, KeeperException.SessionExpiredException, KeeperException.SystemErrorException, KeeperException.UnimplementedException
public abstract class KeeperException
- extends Exception
- See Also:
- Serialized Form
Method Summary |
static KeeperException |
create(int code)
All non-specific keeper exceptions should be constructed via this factory method
in order to guarantee consistency in error codes and such. |
static KeeperException |
create(int 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. |
int |
getCode()
|
String |
getMessage()
|
String |
getPath()
|
void |
setCode(int code)
|
KeeperException
public KeeperException(int code)
create
public static KeeperException create(int 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. 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
public static KeeperException create(int code)
- 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
public void setCode(int code)
getCode
public int getCode()
getPath
public String getPath()
getMessage
public String getMessage()
- Overrides:
getMessage
in class Throwable
Copyright © 2008 The Apache Software Foundation