From aed75bcef418344bfc03bbf69f568c2a2d766dd1 Mon Sep 17 00:00:00 2001 From: zhengwangeng Date: Thu, 3 Sep 2020 18:21:02 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=EF=BC=9ABaseException=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=AD=A3=E7=A1=AE=E5=9C=A8=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E8=BE=93=E5=87=BA=EF=BC=8C=E5=8E=9F=E5=9B=A0=E6=98=AF=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E6=97=B6=E6=8A=9B?= =?UTF-8?q?=E5=87=BA=E7=9A=84=E6=98=AFmessage=EF=BC=8C=E8=80=8C=E9=9D=9Ede?= =?UTF-8?q?faultMessage=EF=BC=8C=E8=80=83=E8=99=91=E5=88=B0=E8=BF=99?= =?UTF-8?q?=E9=87=8C=E5=B9=B6=E6=B2=A1=E6=9C=89=E4=BD=BF=E7=94=A8=EF=BC=8C?= =?UTF-8?q?=E6=89=80=E4=BB=A5=E7=9B=B4=E6=8E=A5=E7=A7=BB=E9=99=A4defaultMe?= =?UTF-8?q?ssage=E3=80=82=20=E4=BC=98=E5=8C=96=EF=BC=9A=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=87=A0=E4=B8=AA=E7=B1=BB=E7=9A=84message=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E7=BB=9F=E4=B8=80=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/exception/BaseException.java | 22 +++++-------------- .../core/exception/CaptchaException.java | 4 ++-- .../core/exception/CustomException.java | 17 ++++++-------- .../core/exception/job/TaskException.java | 8 +++---- 4 files changed, 19 insertions(+), 32 deletions(-) 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; }