yeg
5 天以前 c4bb5bc9314ae5731ecae347c5aa11116ff1445e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.battery.device.api;
 
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)
    {
        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;
    }
}