部分不需要打印具体的 异常
This commit is contained in:
@@ -49,7 +49,8 @@ public class CzgControllerAdvice {
|
|||||||
@ExceptionHandler(value = ApiNotPrintException.class)
|
@ExceptionHandler(value = ApiNotPrintException.class)
|
||||||
@ResponseStatus(HttpStatus.OK)
|
@ResponseStatus(HttpStatus.OK)
|
||||||
public CzgResult<Object> apiNotPrintErrorHandler(ApiNotPrintException ex) {
|
public CzgResult<Object> apiNotPrintErrorHandler(ApiNotPrintException ex) {
|
||||||
setErrorLog(ex);
|
// setErrorLog(ex);
|
||||||
|
log.error("校验异常:{}", ex.getMessage());
|
||||||
return CzgResult.failure(ex.getMessage());
|
return CzgResult.failure(ex.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +95,7 @@ public class CzgControllerAdvice {
|
|||||||
return CzgResult.failure(ex.getCode(), ex.getMsg());
|
return CzgResult.failure(ex.getCode(), ex.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ResponseBody
|
// @ResponseBody
|
||||||
@ExceptionHandler(OrderValidateException.class)
|
@ExceptionHandler(OrderValidateException.class)
|
||||||
// @ResponseStatus(HttpStatus.OK)
|
// @ResponseStatus(HttpStatus.OK)
|
||||||
public CzgResult<Object> handleOrderValidateException(OrderValidateException ex) {
|
public CzgResult<Object> handleOrderValidateException(OrderValidateException ex) {
|
||||||
@@ -121,7 +122,7 @@ public class CzgControllerAdvice {
|
|||||||
|
|
||||||
@ExceptionHandler(MissingServletRequestParameterException.class)
|
@ExceptionHandler(MissingServletRequestParameterException.class)
|
||||||
public CzgResult<Object> handleMissingServletRequestParameterException(MissingServletRequestParameterException ex) {
|
public CzgResult<Object> handleMissingServletRequestParameterException(MissingServletRequestParameterException ex) {
|
||||||
log.error("传参错误", ex);
|
log.error("传参错误:{}", ex.getMessage());
|
||||||
return CzgResult.failure(CzgRespCode.SYSTEM_ERROR.getCode(), "系统繁忙,请稍后再试");
|
return CzgResult.failure(CzgRespCode.SYSTEM_ERROR.getCode(), "系统繁忙,请稍后再试");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user