云
113 分钟以前 95ae0c83d2aa58d86b4039e3f7f16ee93afb8f00
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
package cn.iocoder.yudao.module.system.framework.agent;
 
import org.springframework.http.HttpStatus;
import org.springframework.web.server.ResponseStatusException;
 
import java.util.Map;
 
/** 桥接接口的业务异常,携带真实 HTTP 状态、稳定错误码与可展示明细。 */
public class AgentBridgeException extends ResponseStatusException {
 
    private final String errorCode;
    private final boolean retryable;
    private final Map<String, Object> details;
 
    public AgentBridgeException(HttpStatus status, String errorCode, String message) {
        this(status, errorCode, message, false, null);
    }
 
    public AgentBridgeException(HttpStatus status, String errorCode, String message, boolean retryable,
                                Map<String, Object> details) {
        super(status, message);
        this.errorCode = errorCode;
        this.retryable = retryable;
        this.details = details;
    }
 
    public String getErrorCode() {
        return errorCode;
    }
 
    public boolean isRetryable() {
        return retryable;
    }
 
    public Map<String, Object> getDetails() {
        return details;
    }
}