java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
java.net.SocketException
net.i2p.client.streaming.I2PSocketException
- All Implemented Interfaces:
Serializable
An I2P-specific IOException thrown from input and output streams, with a stored status code to be used for programmatic responses.
- See Also:
Field Summary
Modifier and TypeFieldDescriptionprivate final intStatus code for the exception.private static final StringBundle name.private static final intSentinel for custom message exceptions.static final intRouter and I2CP status codes are 0 - 511.Constructor Summary
ConstructorsConstructorDescriptionI2PSocketException(int status) Use canned message for this status code.I2PSocketException(String message) Use message provided.Method Summary
Modifier and TypeMethodDescriptionprivate static StringLooks a string up in this class's translation bundle.private static StringTag for translation.Looks up the message in the exception's translation bundle.For programmatic action based on specific failure code.intFor programmatic action based on specific failure code.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Field Details
_status
private final int _statusStatus code for the exception.CUSTOM
private static final int CUSTOMSentinel for custom message exceptions.- See Also:
BUNDLE_NAME
STATUS_CONNECTION_RESET
public static final int STATUS_CONNECTION_RESETRouter and I2CP status codes are 0 - 511. Start ours at 512.- See Also:
Constructor Details
I2PSocketException
public I2PSocketException(int status) Use canned message for this status code. Standard codes from the router are 0-255, defined in MessageStatusMessage. Standard codes from client-side I2CP are 256-511, defined in SendMessageStatusListener. Standard codes from streaming are 512-767, defined here.- Parameters:
status- >= 0 from MessageStatusMessage or SendMessageStatusListener
I2PSocketException
Use message provided.- Parameters:
message- the detail message
Method Details
getStatus
public int getStatus()For programmatic action based on specific failure code.- Returns:
- the failure code, either a
MessageStatusMessagestatus supplied to the integer constructor or-1when the exception was constructed from a message alone
getMessage
For programmatic action based on specific failure code.- Overrides:
getMessagein classThrowable- Returns:
- canned message based on status in int constructor or message from String constructor
getLocalizedMessage
Looks up the message in the exception's translation bundle.- Overrides:
getLocalizedMessagein classThrowable- Returns:
- the localized message
_t
_x