代码优化

This commit is contained in:
thinkgem
2024-04-01 11:51:25 +08:00
parent 5dd59473a3
commit a0db2ed70a
2 changed files with 5 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
*/
package com.jeesite.common.lang;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.http.HttpServletRequest;
import java.io.PrintWriter;
@@ -26,8 +27,8 @@ public class ExceptionUtils {
Throwable ex = null;
if (request.getAttribute("exception") != null) {
ex = (Throwable) request.getAttribute("exception");
} else if (request.getAttribute("jakarta.servlet.error.exception") != null) {
ex = (Throwable) request.getAttribute("jakarta.servlet.error.exception");
} else if (request.getAttribute(RequestDispatcher.ERROR_EXCEPTION) != null) {
ex = (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
}
return ex;
}