Skip to content

Commit d549241

Browse files
committed
优化日志打印
1 parent 5e15beb commit d549241

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hsweb-web-controller/src/main/java/org/hsweb/web/controller/RestControllerExceptionTranslator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package org.hsweb.web.controller;
22

33
import com.alibaba.fastjson.JSON;
4-
import org.hsweb.ezorm.rdb.exception.*;
54
import org.hsweb.web.core.exception.*;
6-
import org.hsweb.web.core.exception.ValidationException;
75
import org.hsweb.web.core.message.ResponseMessage;
86
import org.slf4j.Logger;
97
import org.slf4j.LoggerFactory;
@@ -39,6 +37,9 @@ ResponseMessage handleException(org.hsweb.ezorm.rdb.exception.ValidationExceptio
3937
@ResponseBody
4038
ResponseMessage handleException(BusinessException exception, HttpServletResponse response) {
4139
response.setStatus(exception.getStatus());
40+
if (exception.getCause() != null) {
41+
logger.error("{}:{}", exception.getMessage(), exception.getStatus(), exception.getCause());
42+
}
4243
return ResponseMessage.error(exception.getMessage(), exception.getStatus());
4344
}
4445

0 commit comments

Comments
 (0)