You've already forked FrameTour-BE
方便看到是啥报错了
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.ycwl.basic.exception;
|
||||
|
||||
import com.ycwl.basic.aspectj.HttpSaver;
|
||||
import com.ycwl.basic.enums.BizCodeEnum;
|
||||
import com.ycwl.basic.notify.NotifyFactory;
|
||||
import com.ycwl.basic.notify.entity.NotifyContent;
|
||||
@ -72,8 +73,15 @@ public class CustomExceptionHandle {
|
||||
*/
|
||||
@ExceptionHandler(value = Exception.class)
|
||||
public ApiResponse<String> handle(Exception e) {
|
||||
String requestText = getRequestAsText();
|
||||
LOGGER.error("系统异常 -> {}\n{}", e.getMessage(), requestText, e);
|
||||
LOGGER.error("系统异常 -> {}", e.getMessage(), e);
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attributes != null) {
|
||||
try {
|
||||
HttpSaver.saveRequestToFile(attributes.getRequest());
|
||||
} catch (IOException ex) {
|
||||
LOGGER.error("保存请求信息失败 -> {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
return ApiResponse.buildResult(BizCodeEnum.SERVER_UNKONWN_ERROR);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user