diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/BaseException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/BaseException.java index 51145217..e0b4c3bd 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/BaseException.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/BaseException.java @@ -24,17 +24,12 @@ public class BaseException extends RuntimeException */ private Object[] args; - /** - * 错误消息 - */ - private String defaultMessage; - - public BaseException(String module, String code, Object[] args, String defaultMessage) + public BaseException(String module, String code, Object[] args, String message) { + super(message); this.module = module; this.code = code; this.args = args; - this.defaultMessage = defaultMessage; } public BaseException(String module, String code, Object[] args) @@ -42,9 +37,9 @@ public class BaseException extends RuntimeException this(module, code, args, null); } - public BaseException(String module, String defaultMessage) + public BaseException(String module, String message) { - this(module, null, null, defaultMessage); + this(module, null, null, message); } public BaseException(String code, Object[] args) @@ -52,9 +47,9 @@ public class BaseException extends RuntimeException this(null, code, args, null); } - public BaseException(String defaultMessage) + public BaseException(String message) { - this(null, null, null, defaultMessage); + this(null, null, null, message); } public String getModule() @@ -71,9 +66,4 @@ public class BaseException extends RuntimeException { return args; } - - public String getDefaultMessage() - { - return defaultMessage; - } } diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/CaptchaException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/CaptchaException.java index 3e018510..8a687531 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/CaptchaException.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/CaptchaException.java @@ -9,8 +9,8 @@ public class CaptchaException extends RuntimeException { private static final long serialVersionUID = 1L; - public CaptchaException(String msg) + public CaptchaException(String message) { - super(msg); + super(message); } } diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/CustomException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/CustomException.java index 38b727be..090a550d 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/CustomException.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/CustomException.java @@ -11,29 +11,26 @@ public class CustomException extends RuntimeException private Integer code; - private String message; - public CustomException(String message) { - this.message = message; + super(message); } - public CustomException(String message, Integer code) + public CustomException(Integer code, String message) { - this.message = message; + super(message); this.code = code; } - public CustomException(String message, Throwable e) + public CustomException(Integer code, String message, Throwable e) { super(message, e); - this.message = message; + this.code = code; } - @Override - public String getMessage() + public CustomException(String message, Throwable e) { - return message; + super(message, e); } public Integer getCode() diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/job/TaskException.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/job/TaskException.java index c98397c1..74c0d1c1 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/job/TaskException.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/exception/job/TaskException.java @@ -11,14 +11,14 @@ public class TaskException extends Exception private Code code; - public TaskException(String msg, Code code) + public TaskException(String message, Code code) { - this(msg, code, null); + this(message, code, null); } - public TaskException(String msg, Code code, Exception nestedEx) + public TaskException(String message, Code code, Exception nestedEx) { - super(msg, nestedEx); + super(message, nestedEx); this.code = code; }