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
|Constructor and Description|
|Modifier and Type||Method and Description|
Copy the exception.
Builds a custom message for this exception.
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 Map<EndPoint,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_VALUEto 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
public NoHostAvailableException copy()
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.
Copyright © 2012–2023. All rights reserved.