郑永安
2023-09-19 69185134fcfaf913ea45f1255677225a2cc311a4
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.gk.hotwork.Domain.Exception;
 
import com.gk.hotwork.Domain.Enum.ResultCodes;
 
public class BusinessException extends RuntimeException{
    private String code;
    private String error;
 
    public BusinessException(String message) {
        super(message);
    }
 
    public BusinessException(ResultCodes code) {
        super(code.getDesc());
        this.code = code.getCode();
        this.error = code.getDesc();
 
    }
 
    public BusinessException(String code, String error) {
        super(error);
        this.code = code;
        this.error = error;
    }
 
    public BusinessException(E e, String error) {
        super(error);
        this.code = e.getCode();
        this.error = error;
    }
 
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
 
    public String getError() {
        return error;
    }
 
    public void setError(String error) {
        this.error = error;
    }
}