diff --git a/snowy-common/src/main/java/vip/xiaonuo/common/util/CommonFilterExceptionUtil.java b/snowy-common/src/main/java/vip/xiaonuo/common/util/CommonFilterExceptionUtil.java index deaca2c9..9bd3b00c 100644 --- a/snowy-common/src/main/java/vip/xiaonuo/common/util/CommonFilterExceptionUtil.java +++ b/snowy-common/src/main/java/vip/xiaonuo/common/util/CommonFilterExceptionUtil.java @@ -12,9 +12,6 @@ */ package vip.xiaonuo.common.util; -import cn.hutool.core.util.ObjectUtil; -import vip.xiaonuo.common.exception.CommonException; - import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; @@ -35,11 +32,7 @@ public class CommonFilterExceptionUtil { **/ public static void handleFilterException(ServletRequest request, ServletResponse response, Exception e) { try { - if(ObjectUtil.isNotEmpty(e.getMessage())) { - request.setAttribute("model", new CommonException(e.getMessage())); - } else { - request.setAttribute("model", e); - } + request.setAttribute("model", e); request.getRequestDispatcher("/errorView").forward(request, response); } catch (Exception ignored) { } diff --git a/snowy-web-app/src/main/java/vip/xiaonuo/core/handler/GlobalErrorViewController.java b/snowy-web-app/src/main/java/vip/xiaonuo/core/handler/GlobalErrorViewController.java index a6a3b5c2..1cfd2517 100644 --- a/snowy-web-app/src/main/java/vip/xiaonuo/core/handler/GlobalErrorViewController.java +++ b/snowy-web-app/src/main/java/vip/xiaonuo/core/handler/GlobalErrorViewController.java @@ -53,6 +53,8 @@ public class GlobalErrorViewController { } else { commonResult = CommonResult.error(); } + Exception exception = (Exception) model; + exception.printStackTrace(); } log.error(">>> {}", commonResult.getMsg()); return commonResult;