修改生产环境异常输出

This commit is contained in:
ajaxfan
2021-03-25 19:10:41 +08:00
parent 159bab5d60
commit 2c0e0e608a

View File

@ -96,7 +96,7 @@ public class BusinessExceptionHandlerAdvicePro {
Map<String, Object> body = new HashMap<>();
body.put("errors", JsonUtils.objectToJson(invalidArguments));
body.put("error", HttpStatus.BAD_REQUEST.getReasonPhrase());
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "参数验证错误", Convert.toStr(body));
}
@ -160,7 +160,7 @@ public class BusinessExceptionHandlerAdvicePro {
body.put("errors", exception.getMessage());
body.put("error", HttpStatus.BAD_REQUEST.getReasonPhrase());
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "参数缺失" + exception.getMessage(), Convert.toStr(body));
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "参数缺失", Convert.toStr(body));
}
// ----------------------------data--------------------------------------
@ -180,7 +180,7 @@ public class BusinessExceptionHandlerAdvicePro {
body.put("errors", exception.getMessage());
body.put("error", HttpStatus.BAD_REQUEST.getReasonPhrase());
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "数据库异常" + exception.getMessage(), Convert.toStr(body));
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "数据库异常", Convert.toStr(body));
}
/**
@ -252,8 +252,7 @@ public class BusinessExceptionHandlerAdvicePro {
body.put("errors", exception.getMessage());
body.put("error", HttpStatus.INTERNAL_SERVER_ERROR.getReasonPhrase());
return BaseResponse.fail(HttpStatus.INTERNAL_SERVER_ERROR.value(), "系统异常" + exception.getMessage(),
Convert.toStr(body));
return BaseResponse.fail(HttpStatus.INTERNAL_SERVER_ERROR.value(), "系统异常", Convert.toStr(body));
}
@ExceptionHandler({ TransactionSystemException.class })