修改生产环境异常输出
This commit is contained in:
@ -96,7 +96,7 @@ public class BusinessExceptionHandlerAdvicePro {
|
|||||||
Map<String, Object> body = new HashMap<>();
|
Map<String, Object> body = new HashMap<>();
|
||||||
body.put("errors", JsonUtils.objectToJson(invalidArguments));
|
body.put("errors", JsonUtils.objectToJson(invalidArguments));
|
||||||
body.put("error", HttpStatus.BAD_REQUEST.getReasonPhrase());
|
body.put("error", HttpStatus.BAD_REQUEST.getReasonPhrase());
|
||||||
|
|
||||||
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "参数验证错误", Convert.toStr(body));
|
return BaseResponse.fail(HttpStatus.BAD_REQUEST.value(), "参数验证错误", Convert.toStr(body));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ public class BusinessExceptionHandlerAdvicePro {
|
|||||||
body.put("errors", exception.getMessage());
|
body.put("errors", exception.getMessage());
|
||||||
body.put("error", HttpStatus.BAD_REQUEST.getReasonPhrase());
|
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--------------------------------------
|
// ----------------------------data--------------------------------------
|
||||||
@ -180,7 +180,7 @@ public class BusinessExceptionHandlerAdvicePro {
|
|||||||
body.put("errors", exception.getMessage());
|
body.put("errors", exception.getMessage());
|
||||||
body.put("error", HttpStatus.BAD_REQUEST.getReasonPhrase());
|
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("errors", exception.getMessage());
|
||||||
body.put("error", HttpStatus.INTERNAL_SERVER_ERROR.getReasonPhrase());
|
body.put("error", HttpStatus.INTERNAL_SERVER_ERROR.getReasonPhrase());
|
||||||
|
|
||||||
return BaseResponse.fail(HttpStatus.INTERNAL_SERVER_ERROR.value(), "系统异常" + exception.getMessage(),
|
return BaseResponse.fail(HttpStatus.INTERNAL_SERVER_ERROR.value(), "系统异常", Convert.toStr(body));
|
||||||
Convert.toStr(body));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler({ TransactionSystemException.class })
|
@ExceptionHandler({ TransactionSystemException.class })
|
||||||
|
Reference in New Issue
Block a user