轻量优化: 重复提取一个异常信息==>只提取一次

Signed-off-by: liruohrh <2372221537@qq.com>
pull/64/head
liruohrh 7 months ago committed by Gitee
parent 3134aff968
commit c6d981ffc6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -26,8 +26,9 @@ public class ExceptionHandlerAdvice {
@ExceptionHandler({Exception.class}) @ExceptionHandler({Exception.class})
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
public BasicResultVO<String> exceptionResponse(Exception e) { public BasicResultVO<String> exceptionResponse(Exception e) {
log.error(Throwables.getStackTrace(e)); String errStackStr = Throwables.getStackTrace(e);
return BasicResultVO.fail(RespStatusEnum.ERROR_500, "\r\n" + Throwables.getStackTrace(e) + "\r\n"); log.error(errStackStr);
return BasicResultVO.fail(RespStatusEnum.ERROR_500, "\r\n" + errStackStr + "\r\n");
} }
@ExceptionHandler({CommonException.class}) @ExceptionHandler({CommonException.class})

Loading…
Cancel
Save