add
yj
2024-12-05 a160d838f9c0a79dfc2f18e7cd46bdd4faa59c6d
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
package com.dobbinsoft.fw.core.exception;
 
import java.io.Serializable;
 
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: rize
 * Date: 2019-01-31
 * Time: 下午8:07
 */
public abstract class ServiceException extends Exception implements Serializable {
 
    private int code;
 
    private Object attach;
 
    public int getCode() {
        return code;
    }
 
    public void setCode(int code) {
        this.code = code;
    }
 
    public Object getAttach() {
        return attach;
    }
 
    public ServiceException() {
    }
 
    public ServiceException(String message, int code) {
        super(message);
        this.code = code;
    }
 
    public ServiceException(ServiceExceptionDefinition definition) {
        super(definition.getMsg());
        this.code = definition.getCode();
    }
 
    public ServiceException attach(Object attach) {
        this.attach = attach;
        return this;
    }
}