DeviceException is a special IOException, which is thrown to
indicate that there is a device operation fail. The error reason can be
located with getCode() method. The cause is available with
getCause().
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| public static final int | COMMUNICATION_ERROR
An exception code indicates that there is an error in the communication. |
| public static final int | NO_DATA
An exception code indicates that the requested value is currently not available. |
| public static final int | NOT_INITIALIZED
An exception code indicates that the device is not initialized. |
| private static final long | |
| public static final int | TIMEOUT
An exception code indicates that there is expired timeout without any processing. |
| public static final int | UNKNOWN
An exception code indicates that the error is unknown. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DeviceException(String
The exception message. message)Constructs a new device exception with the given message. |
| public | DeviceException(String
The exception message. message, Throwable The exception cause. cause)Constructs a new device exception with the given message and cause. |
| public | DeviceException(String
The exception message. message, Throwable The exception cause. cause, int The exception code. code)Constructs a new device exception with the given message, cause and code. |
| Modifier and Type | Method and Description |
|---|---|
| public int |
| code | back to summary |
|---|---|
| private final int code | |
| COMMUNICATION_ERROR | back to summary |
|---|---|
| public static final int COMMUNICATION_ERROR An exception code indicates that there is an error in the communication. | |
| NO_DATA | back to summary |
|---|---|
| public static final int NO_DATA An exception code indicates that the requested value is currently not available. | |
| NOT_INITIALIZED | back to summary |
|---|---|
| public static final int NOT_INITIALIZED An exception code indicates that the device is not initialized. The
device status is | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| TIMEOUT | back to summary |
|---|---|
| public static final int TIMEOUT An exception code indicates that there is expired timeout without any processing. | |
| UNKNOWN | back to summary |
|---|---|
| public static final int UNKNOWN An exception code indicates that the error is unknown. | |
| DeviceException | back to summary |
|---|---|
| public DeviceException() Construct a new device exception with | |
| DeviceException | back to summary |
|---|---|
| public DeviceException(String message) Constructs a new device exception with the given message. The cause is
not initialized and the exception code is set to
| |
| DeviceException | back to summary |
|---|---|
| public DeviceException(String message, Throwable cause) Constructs a new device exception with the given message and cause. The
exception code is set to | |
| DeviceException | back to summary |
|---|---|
| public DeviceException(String message, Throwable cause, int code) Constructs a new device exception with the given message, cause and code. | |
| getCode | back to summary |
|---|---|
| public int getCode() Returns the exception code. It indicates the reason for this exception. The code can be:
| |