public final class ErrnoException extends Exception
Os
methods fail. This exception contains the native
errno value, for comparison against the constants in OsConstants
, should sophisticated
callers need to adjust their behavior based on the exact failure.Modifier and Type | Field and Description |
---|---|
int |
errno
The errno value, for comparison with the
E constants in OsConstants . |
Constructor and Description |
---|
ErrnoException(String functionName,
int errno)
Constructs an instance with the given function name and errno value.
|
ErrnoException(String functionName,
int errno,
Throwable cause)
Constructs an instance with the given function name, errno value, and cause.
|
Modifier and Type | Method and Description |
---|---|
String |
getMessage()
Converts the stashed function name and errno value to a human-readable string.
|
IOException |
rethrowAsIOException() |
SocketException |
rethrowAsSocketException() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public final int errno
E
constants in OsConstants
.public ErrnoException(String functionName, int errno)
public String getMessage()
getMessage
in class Throwable
Throwable
instance
(which may be null
).public IOException rethrowAsIOException() throws IOException
IOException
public SocketException rethrowAsSocketException() throws SocketException
SocketException