| | |
| | | public class DeviceAdapterException extends RuntimeException |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | private static final String DEFAULT_FAILURE_CODE = "ADAPTER_FAILURE"; |
| | | |
| | | private final String failureCode; |
| | | |
| | | public DeviceAdapterException(String message) |
| | | { |
| | | super(message); |
| | | this(DEFAULT_FAILURE_CODE, message, null); |
| | | } |
| | | |
| | | public DeviceAdapterException(String message, Throwable cause) |
| | | { |
| | | this(DEFAULT_FAILURE_CODE, message, cause); |
| | | } |
| | | |
| | | public DeviceAdapterException(String failureCode, String message, Throwable cause) |
| | | { |
| | | super(message, cause); |
| | | this.failureCode = failureCode; |
| | | } |
| | | |
| | | /** 返回供业务层持久化和恢复判断使用的稳定失败分类。 */ |
| | | public String failureCode() |
| | | { |
| | | return failureCode; |
| | | } |
| | | } |