bugFix:NullPointerException的getMessage默认是null,所以没有必要打印出来,直接打印错误堆栈即可

This commit is contained in:
yangzhengwu
2023-07-03 16:27:50 +08:00
parent c47b48760d
commit d08a22d6b1

View File

@@ -42,7 +42,7 @@ public class GlobalExceptionHandler {
*/
@ExceptionHandler(value = NullPointerException.class)
public ApiResult exceptionHandler(NullPointerException e) {
log.error("null point exceptionThe reason is:{}", e.getMessage(), e);
log.error("null point exceptionThe reason is: ", e);
return ApiResult.fail(CommonErrorEnum.SYSTEM_ERROR);
}