xiongzhu 4 tahun lalu
induk
melakukan
110cec8cc1

+ 1 - 2
src/main/java/com/izouma/awesomeAdmin/exception/BusinessException.java

@@ -9,8 +9,7 @@ public class BusinessException extends RuntimeException implements Supplier<Busi
     private String  error;
 
     public BusinessException(String error) {
-        super();
-        this.error = error;
+        super(error);
     }
 
     public BusinessException(String error, String message) {

+ 1 - 2
src/main/java/com/izouma/awesomeAdmin/exception/GlobalExceptionHandler.java

@@ -34,8 +34,7 @@ public class GlobalExceptionHandler {
     @ResponseBody
     public Map<String, Object> serviceExceptionHandler(BusinessException e) {
         Map<String, Object> map = new HashMap<>();
-        map.put("error", e.getError());
-        map.put("message", e.getMessage());
+        map.put("error", e.getMessage());
         map.put("code", -1);
         return map;
     }