public class NoHostAvailableException extends DriverException
This exception is thrown if either:
For debugging purposes, the list of hosts that have been tried along with the failure cause
can be retrieved using the getErrors()
method.
Constructor and Description |
---|
NoHostAvailableException(Map<InetSocketAddress,Throwable> errors) |
Modifier and Type | Method and Description |
---|---|
NoHostAvailableException |
copy()
Copy the exception.
|
String |
getCustomMessage(int maxErrors,
boolean formatted,
boolean includeStackTraces)
Builds a custom message for this exception.
|
Map<InetSocketAddress,Throwable> |
getErrors()
Return the hosts tried along with the error encountered while trying them.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public NoHostAvailableException(Map<InetSocketAddress,Throwable> errors)
public Map<InetSocketAddress,Throwable> getErrors()
public String getCustomMessage(int maxErrors, boolean formatted, boolean includeStackTraces)
maxErrors
- the maximum number of errors displayed (useful to limit the size of the
message for big clusters). Beyond this limit, host names are still displayed, but not the
associated errors. Set to Integer.MAX_VALUE
to display all hosts.formatted
- whether to format the output (line break between each host).includeStackTraces
- whether to include the full stacktrace of each host error. Note that
this automatically implies formatted
.public NoHostAvailableException copy()
DriverException
This returns a new exception, equivalent to the original one, except that because a new object is created in the current thread, the top-most element in the stacktrace of the exception will refer to the current thread (this is mainly intended for internal use by the driver). The cause of the copied exception will be the original exception.
copy
in class DriverException
Copyright © 2012–2018. All rights reserved.