优化统一错误码返回
This commit is contained in:
parent
6be7aad22e
commit
42e26ebd67
@ -129,7 +129,8 @@ public class Response<Data> implements Serializable {
|
|||||||
public Response<Data> failure(RuntimeContext runtimeContext, HttpStatus httpStatus, CustomException customException) {
|
public Response<Data> failure(RuntimeContext runtimeContext, HttpStatus httpStatus, CustomException customException) {
|
||||||
setHandleSuccess(false);
|
setHandleSuccess(false);
|
||||||
setErrorDetail(customException.getStackTrace()); // 异常堆栈
|
setErrorDetail(customException.getStackTrace()); // 异常堆栈
|
||||||
return any(runtimeContext, httpStatus, customException.getCode(), customException.getMessage(), null);
|
// 错误码使用 category+_+code
|
||||||
|
return any(runtimeContext, httpStatus, customException.getCategory() + "_"+customException.getCode(), customException.getMessage(), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 任意姿势的响应
|
// 任意姿势的响应
|
||||||
|
Loading…
x
Reference in New Issue
Block a user