소스 검색

暂时做处理

czh 2 년 전
부모
커밋
69c51a00c6
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/GlobalSystemExceptionHandler.java

+ 7 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/exception/GlobalSystemExceptionHandler.java

@@ -22,12 +22,18 @@ import java.util.Set;
 @Configuration
 public class GlobalSystemExceptionHandler {
 
-    @ExceptionHandler(value = {SystemException.class, RuntimeException.class})
+    @ExceptionHandler(value = SystemException.class)
     @ResponseBody
     public HttpResult handlerSystemException(SystemException e) {
         return HttpResult.error(e.getCode(), e.getMessage());
     }
 
+    @ExceptionHandler(value = RuntimeException.class)
+    @ResponseBody
+    public HttpResult handlerRuntimeException(RuntimeException e) {
+        return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+    }
+
     /**
      * BusinessException处理
      *