From 6e72545fc4ff922354192b16eb14e92c1e1f75c1 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 16 七月 2024 09:49:47 +0800
Subject: [PATCH] 登录空指针异常

---
 src/main/java/com/mindskip/xzs/configuration/spring/exception/ExceptionHandle.java |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/mindskip/xzs/configuration/spring/exception/ExceptionHandle.java b/src/main/java/com/mindskip/xzs/configuration/spring/exception/ExceptionHandle.java
index aa5d8bf..5c5acef 100644
--- a/src/main/java/com/mindskip/xzs/configuration/spring/exception/ExceptionHandle.java
+++ b/src/main/java/com/mindskip/xzs/configuration/spring/exception/ExceptionHandle.java
@@ -69,5 +69,17 @@
         return new RestResponse<>(SystemCode.ParameterValidError.getCode(), errorMsg);
     }
 
+    @ExceptionHandler(QuestionException.class)
+    @ResponseBody
+    public RestResponse handler(QuestionException e) {
+        logger.error(e.getMessage(), e);
+        return new RestResponse<>(SystemCode.QuestionError.getCode(), SystemCode.QuestionError.getMessage());
+    }
 
+    @ExceptionHandler(RuntimeException.class)
+    @ResponseBody
+    public RestResponse handlerRuntimeException(RuntimeException e) {
+        logger.error(e.getMessage(), e);
+        return new RestResponse<>(SystemCode.InnerError.getCode(), e.getMessage());
+    }
 }

--
Gitblit v1.8.0