jiangping
2025-07-15 c4bd6e7e1fadfac44466d589ee4d5dfcf77c2a59
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
package com.doumee.core.exception;
 
import com.doumee.core.constants.ResponseStatus;
import lombok.Data;
 
/**
 * 业务异常对象
 * @author  dm
 * @since 2025/03/31 16:44
 */
@Data
public class BusinessException extends RuntimeException {
 
    private Integer code;
 
    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
    }
 
    public BusinessException(Integer code, String message, Throwable e) {
        super(message, e);
        this.code = code;
    }
 
    public BusinessException(ResponseStatus status) {
        super(status.getMessage());
        this.code = status.getCode();
    }
 
    public BusinessException(ResponseStatus status, Throwable e) {
        super(status.getMessage(), e);
        this.code = status.getCode();
    }
}