懒羊羊
2024-01-31 e57a8990ae56f657a59c435a0613c5f7a8728003
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package com.jcdm.common.exception;
 
/**
 * 业务异常
 * 
 * @author jc
 */
public final class ServiceException extends RuntimeException
{
    private static final long serialVersionUID = 1L;
 
    /**
     * 错误码
     */
    private Integer code;
 
    /**
     * 错误提示
     */
    private String message;
 
    /**
     * 错误明细,内部调试错误
     *
     * 和 {@link CommonResult#getDetailMessage()} 一致的设计
     */
    private String detailMessage;
 
    /**
     * 空构造方法,避免反序列化问题
     */
    public ServiceException()
    {
    }
 
    public ServiceException(String message)
    {
        this.message = message;
    }
 
    public ServiceException(String message, Integer code)
    {
        this.message = message;
        this.code = code;
    }
 
    public String getDetailMessage()
    {
        return detailMessage;
    }
 
    @Override
    public String getMessage()
    {
        return message;
    }
 
    public Integer getCode()
    {
        return code;
    }
 
    public ServiceException setMessage(String message)
    {
        this.message = message;
        return this;
    }
 
    public ServiceException setDetailMessage(String detailMessage)
    {
        this.detailMessage = detailMessage;
        return this;
    }
}