|
|
@ -136,6 +136,7 @@ public class GlobalExceptionHandler {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ExceptionHandler(BindException.class)
|
|
|
|
@ExceptionHandler(BindException.class)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
|
|
|
|
public ErrorResponseData bindException(BindException e) {
|
|
|
|
public ErrorResponseData bindException(BindException e) {
|
|
|
|
String bindingResult = getArgNotValidMessage(e.getBindingResult());
|
|
|
|
String bindingResult = getArgNotValidMessage(e.getBindingResult());
|
|
|
|
return renderJson(ValidatorExceptionEnum.VALIDATED_RESULT_ERROR, bindingResult);
|
|
|
|
return renderJson(ValidatorExceptionEnum.VALIDATED_RESULT_ERROR, bindingResult);
|
|
|
@ -149,6 +150,7 @@ public class GlobalExceptionHandler {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ExceptionHandler(ValidationException.class)
|
|
|
|
@ExceptionHandler(ValidationException.class)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
|
|
|
|
public ErrorResponseData bindException(ValidationException e) {
|
|
|
|
public ErrorResponseData bindException(ValidationException e) {
|
|
|
|
if (e.getCause() instanceof ParamValidateException) {
|
|
|
|
if (e.getCause() instanceof ParamValidateException) {
|
|
|
|
ParamValidateException paramValidateException = (ParamValidateException) e.getCause();
|
|
|
|
ParamValidateException paramValidateException = (ParamValidateException) e.getCause();
|
|
|
@ -164,6 +166,7 @@ public class GlobalExceptionHandler {
|
|
|
|
* @date 2020/12/16 15:11
|
|
|
|
* @date 2020/12/16 15:11
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ExceptionHandler(ServiceException.class)
|
|
|
|
@ExceptionHandler(ServiceException.class)
|
|
|
|
|
|
|
|
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ErrorResponseData businessError(ServiceException e) {
|
|
|
|
public ErrorResponseData businessError(ServiceException e) {
|
|
|
|
log.error("业务异常,具体信息为:{}", e.getMessage());
|
|
|
|
log.error("业务异常,具体信息为:{}", e.getMessage());
|
|
|
|