shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
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
package com.walker.web;
 
import com.walker.infrastructure.ApplicationRuntimeException;
 
/**
 * WEB 层面抛出的业务异常定义,框架会整体在 <code>RestController</code> 中拦截并返回响应。
 * @author 时克英
 * @date 2022-10-12
 */
public class WebRuntimeException extends ApplicationRuntimeException {
 
    private int code = ResponseValue.CODE_ERROR;
    private String msg;
 
    private String data;
 
    public int getCode() {
        return code;
    }
 
    public String getMsg() {
        return msg;
    }
 
    public String getData() {
        return data;
    }
 
    public WebRuntimeException(String msg){
        super(msg);
        this.msg = msg;
    }
 
    public WebRuntimeException(String msg, Throwable cause){
        super(msg, cause);
        this.msg = msg;
    }
 
    public WebRuntimeException(int code, String msg, String data){
        super(msg);
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public WebRuntimeException(String msg, String data){
        super(msg);
        this.msg = msg;
        this.data = data;
    }
}