修改统一异常处理
This commit is contained in:
@ -161,7 +161,7 @@ public class BusinessExceptionHandlerAdvice {
|
||||
body.put("errors", exception.getMessage());
|
||||
body.put("error", HttpStatus.BAD_REQUEST.getReasonPhrase());
|
||||
// body.put("path", request.getRequestURI());
|
||||
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "参数缺失" + exception.getMessage(), Convert.toStr(body));
|
||||
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "参数缺失", Convert.toStr(body));
|
||||
}
|
||||
|
||||
// ----------------------------data--------------------------------------
|
||||
@ -181,7 +181,7 @@ public class BusinessExceptionHandlerAdvice {
|
||||
body.put("errors", exception.getMessage());
|
||||
body.put("error", HttpStatus.BAD_REQUEST.getReasonPhrase());
|
||||
// body.put("path", request.getRequestURI());
|
||||
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "数据库异常" + exception.getMessage(), Convert.toStr(body));
|
||||
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "数据库异常", Convert.toStr(body));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -253,7 +253,7 @@ public class BusinessExceptionHandlerAdvice {
|
||||
body.put("errors", exception.getMessage());
|
||||
body.put("error", HttpStatus.INTERNAL_SERVER_ERROR.getReasonPhrase());
|
||||
// body.put("path", request.getRequestURI());
|
||||
return BaseResponse.fail(HttpStatus.INTERNAL_SERVER_ERROR.value(), "系统异常:" + exception.getMessage(),
|
||||
return BaseResponse.fail(HttpStatus.INTERNAL_SERVER_ERROR.value(), "系统异常",
|
||||
Convert.toStr(body));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user