public final class GaiException extends RuntimeException
getaddrinfo
or getnameinfo
fails.
This exception contains the native error
value, should sophisticated
callers need to adjust their behavior based on the exact failure.Modifier and Type | Field and Description |
---|---|
int |
error
The native error value, for comparison with the
GAI_ constants in OsConstants . |
Constructor and Description |
---|
GaiException(String functionName,
int error)
Constructs an instance with the given function name and error value.
|
GaiException(String functionName,
int error,
Throwable cause)
Constructs an instance with the given function name, error value, and cause.
|
Modifier and Type | Method and Description |
---|---|
String |
getMessage()
Converts the stashed function name and error value to a human-readable string.
|
UnknownHostException |
rethrowAsUnknownHostException() |
UnknownHostException |
rethrowAsUnknownHostException(String detailMessage) |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public final int error
GAI_
constants in OsConstants
.public GaiException(String functionName, int error)
public String getMessage()
getMessage
in class Throwable
Throwable
instance
(which may be null
).public UnknownHostException rethrowAsUnknownHostException(String detailMessage) throws UnknownHostException
UnknownHostException
public UnknownHostException rethrowAsUnknownHostException() throws UnknownHostException
UnknownHostException