优化统一错误码返回

This commit is contained in:
zhangdeman committed 2025-06-16 16:54:37 +08:00
1 parent 6be7aad22e
commit 42e26ebd67
1 file changed
+2 -1
@@ -129,7 +129,8 @@ public class Response<Data> implements Serializable {
public Response<Data> failure(RuntimeContext runtimeContext, HttpStatus httpStatus, CustomException customException) {
setHandleSuccess(false);
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);
}
// 任意姿势的响应
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.