@InterfaceAudience.Public
public abstract class KeeperException
extends java.lang.Exception
Constructor and Description |
---|
KeeperException(KeeperException.Code code) |
Modifier and Type | Method and Description |
---|---|
KeeperException.Code |
code()
Read the error Code for this exception
|
static KeeperException |
create(int code)
Deprecated.
deprecated in 3.1.0, use
create(Code)
instead |
static KeeperException |
create(int code,
java.lang.String path)
Deprecated.
deprecated in 3.1.0, use
create(Code, String)
instead |
static KeeperException |
create(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 KeeperException |
create(KeeperException.Code code,
java.lang.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()
Deprecated.
deprecated in 3.1.0, use
code() instead |
java.lang.String |
getMessage() |
java.lang.String |
getPath()
Read the path for this exception
|
java.util.List<org.apache.zookeeper.OpResult> |
getResults()
If this exception was thrown by a multi-request then the (partial) results
and error codes can be retrieved using this getter.
|
void |
setCode(int code)
Deprecated.
deprecated in 3.1.0, exceptions should be immutable, this
method should not be used
|
public KeeperException(KeeperException.Code code)
public static KeeperException create(KeeperException.Code code, java.lang.String path)
code
- The error code.path
- The ZooKeeper path being operated on.@Deprecated public static KeeperException create(int code, java.lang.String path)
create(Code, String)
instead@Deprecated public static KeeperException create(int code)
create(Code)
insteadpublic static KeeperException create(KeeperException.Code code)
code
- The error code of your new exception. This will
also determine the specific type of the exception that is
returned.@Deprecated public void setCode(int code)
code
- error code@Deprecated public int getCode()
code()
insteadpublic KeeperException.Code code()
public java.lang.String getPath()
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.util.List<org.apache.zookeeper.OpResult> getResults()
Copyright © 2018 The Apache Software Foundation