@InterfaceAudience.Public public abstract class KeeperException extends 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,
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,
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 |
String |
getMessage() |
String |
getPath()
Read the path for this exception
|
List<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
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public KeeperException(KeeperException.Code code)
public static KeeperException create(KeeperException.Code code, String path)
code
- The error code.path
- The ZooKeeper path being operated on.@Deprecated public static KeeperException create(int code, 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 String getPath()
public String getMessage()
getMessage
in class Throwable
Copyright © 2008–2019 The Apache Software Foundation. All rights reserved.