fix: 尝试解决后台日志输出converter的问题

This commit is contained in:
CaptainB 2024-06-24 16:36:44 +08:00 committed by Craftsman
parent 0e964a9443
commit 45cd225c66
1 changed files with 11 additions and 5 deletions

View File

@ -114,11 +114,17 @@ public class RestControllerExceptionHandler {
}
@ExceptionHandler({Exception.class})
public ResponseEntity<ResultHolder> handlerException(Exception e) {
if (e instanceof EofException) {
return ResponseEntity.internalServerError()
.body(ResultHolder.error(MsHttpResultCode.FAILED.getCode(),
e.getMessage(), null));
public ResponseEntity<ResultHolder> handleException(Exception e) {
return ResponseEntity.internalServerError()
.body(ResultHolder.error(MsHttpResultCode.FAILED.getCode(),
e.getMessage(), getStackTraceAsString(e)));
}
@ExceptionHandler({EofException.class})
public ResponseEntity<Object> handleEofException(HttpServletRequest request, Exception e) {
String requestURI = request.getRequestURI();
if (StringUtils.startsWith(requestURI, "/assets")) {
return ResponseEntity.internalServerError().body(null);
}
return ResponseEntity.internalServerError()
.body(ResultHolder.error(MsHttpResultCode.FAILED.getCode(),