wangrong
2026-08-30 761e5c5fa871959f60e15c971c8d83f2b53d0af5
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
package io.dataease.exception;
 
import io.dataease.result.ResultCode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
 
import java.io.Serial;
 
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
public class DEException extends RuntimeException {
 
    @Serial
    private static final long serialVersionUID = 8170873998824378304L;
    private int code;
 
    private String msg;
 
    public DEException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
 
    private DEException(String message) {
        this(ResultCode.SYSTEM_INNER_ERROR.code(), message);
    }
 
    private DEException(Throwable t) {
        super(t);
        this.code = ResultCode.SYSTEM_INNER_ERROR.code();
        this.msg = t.getMessage();
    }
 
    public static void throwException(String message) {
        throw new DEException(message);
    }
 
    public static void throwException(int code, String message) {
        throw new DEException(code, message);
    }
 
    public static DEException getException(String message) {
        throw new DEException(message);
    }
 
    public static void throwException(Throwable t) {
        throw new DEException(t);
    }
}