public class NoHostAvailableException extends DriverException
errors
method.Constructor and Description |
---|
NoHostAvailableException(Map<InetSocketAddress,Throwable> errors) |
Modifier and Type | Method and Description |
---|---|
DriverException |
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 DriverException copy()
DriverException
This return 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 mainly use for internal use by the driver). The cause of the copied exception will be the original exception.
copy
in class DriverException
Copyright © 2012–2015. All rights reserved.