diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/ftp/FtpException.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/ftp/FtpException.java index d1e48edac..0116a9250 100644 --- a/hutool-extra/src/main/java/org/dromara/hutool/extra/ftp/FtpException.java +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/ftp/FtpException.java @@ -12,38 +12,74 @@ package org.dromara.hutool.extra.ftp; -import org.dromara.hutool.core.exception.ExceptionUtil; -import org.dromara.hutool.core.text.StrUtil; +import org.dromara.hutool.core.exception.HutoolException; /** * Ftp异常 * * @author Looly */ -public class FtpException extends RuntimeException { - private static final long serialVersionUID = -8490149159895201756L; +public class FtpException extends HutoolException { + private static final long serialVersionUID = 1L; + /** + * 构造 + * + * @param e 异常 + */ public FtpException(final Throwable e) { - super(ExceptionUtil.getMessage(e), e); + super(e); } + /** + * 构造 + * + * @param message 消息 + */ public FtpException(final String message) { super(message); } + /** + * 构造 + * + * @param messageTemplate 消息模板 + * @param params 参数 + */ public FtpException(final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params)); + super(messageTemplate, params); } - public FtpException(final String message, final Throwable throwable) { - super(message, throwable); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + */ + public FtpException(final String message, final Throwable cause) { + super(message, cause); } - public FtpException(final String message, final Throwable throwable, final boolean enableSuppression, final boolean writableStackTrace) { - super(message, throwable, enableSuppression, writableStackTrace); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + * @param enableSuppression 是否启用抑制 + * @param writableStackTrace 堆栈跟踪是否应该是可写的 + */ + public FtpException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); } - public FtpException(final Throwable throwable, final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params), throwable); + /** + * 构造 + * + * @param cause 被包装的子异常 + * @param messageTemplate 消息模板 + * @param params 参数 + */ + public FtpException(final Throwable cause, final String messageTemplate, final Object... params) { + super(cause, messageTemplate, params); } } diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mail/MailException.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mail/MailException.java index 240204e5d..d2ef85ac2 100644 --- a/hutool-extra/src/main/java/org/dromara/hutool/extra/mail/MailException.java +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mail/MailException.java @@ -12,37 +12,74 @@ package org.dromara.hutool.extra.mail; -import org.dromara.hutool.core.exception.ExceptionUtil; -import org.dromara.hutool.core.text.StrUtil; +import org.dromara.hutool.core.exception.HutoolException; /** * 邮件异常 + * * @author Looly */ -public class MailException extends RuntimeException{ - private static final long serialVersionUID = 8247610319171014183L; +public class MailException extends HutoolException { + private static final long serialVersionUID = 1L; + /** + * 构造 + * + * @param e 异常 + */ public MailException(final Throwable e) { - super(ExceptionUtil.getMessage(e), e); + super(e); } + /** + * 构造 + * + * @param message 消息 + */ public MailException(final String message) { super(message); } + /** + * 构造 + * + * @param messageTemplate 消息模板 + * @param params 参数 + */ public MailException(final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params)); + super(messageTemplate, params); } - public MailException(final String message, final Throwable throwable) { - super(message, throwable); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + */ + public MailException(final String message, final Throwable cause) { + super(message, cause); } - public MailException(final String message, final Throwable throwable, final boolean enableSuppression, final boolean writableStackTrace) { - super(message, throwable, enableSuppression, writableStackTrace); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + * @param enableSuppression 是否启用抑制 + * @param writableStackTrace 堆栈跟踪是否应该是可写的 + */ + public MailException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); } - public MailException(final Throwable throwable, final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params), throwable); + /** + * 构造 + * + * @param cause 被包装的子异常 + * @param messageTemplate 消息模板 + * @param params 参数 + */ + public MailException(final Throwable cause, final String messageTemplate, final Object... params) { + super(cause, messageTemplate, params); } } diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/management/ManagementException.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/management/ManagementException.java index f2246105b..c456e28bf 100644 --- a/hutool-extra/src/main/java/org/dromara/hutool/extra/management/ManagementException.java +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/management/ManagementException.java @@ -12,38 +12,74 @@ package org.dromara.hutool.extra.management; -import org.dromara.hutool.core.exception.ExceptionUtil; -import org.dromara.hutool.core.text.StrUtil; +import org.dromara.hutool.core.exception.HutoolException; /** * FtpException异常 * * @author Looly */ -public class ManagementException extends RuntimeException { +public class ManagementException extends HutoolException { private static final long serialVersionUID = 1L; + /** + * 构造 + * + * @param e 异常 + */ public ManagementException(final Throwable e) { - super(ExceptionUtil.getMessage(e), e); + super(e); } + /** + * 构造 + * + * @param message 消息 + */ public ManagementException(final String message) { super(message); } + /** + * 构造 + * + * @param messageTemplate 消息模板 + * @param params 参数 + */ public ManagementException(final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params)); + super(messageTemplate, params); } - public ManagementException(final String message, final Throwable throwable) { - super(message, throwable); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + */ + public ManagementException(final String message, final Throwable cause) { + super(message, cause); } - public ManagementException(final String message, final Throwable throwable, final boolean enableSuppression, final boolean writableStackTrace) { - super(message, throwable, enableSuppression, writableStackTrace); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + * @param enableSuppression 是否启用抑制 + * @param writableStackTrace 堆栈跟踪是否应该是可写的 + */ + public ManagementException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); } - public ManagementException(final Throwable throwable, final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params), throwable); + /** + * 构造 + * + * @param cause 被包装的子异常 + * @param messageTemplate 消息模板 + * @param params 参数 + */ + public ManagementException(final Throwable cause, final String messageTemplate, final Object... params) { + super(cause, messageTemplate, params); } } diff --git a/hutool-http/src/main/java/org/dromara/hutool/http/HttpException.java b/hutool-http/src/main/java/org/dromara/hutool/http/HttpException.java index 6e3614b68..404bb8ab2 100644 --- a/hutool-http/src/main/java/org/dromara/hutool/http/HttpException.java +++ b/hutool-http/src/main/java/org/dromara/hutool/http/HttpException.java @@ -12,37 +12,74 @@ package org.dromara.hutool.http; -import org.dromara.hutool.core.text.StrUtil; +import org.dromara.hutool.core.exception.HutoolException; /** * HTTP异常 * * @author Looly */ -public class HttpException extends RuntimeException { - private static final long serialVersionUID = 8247610319171014183L; +public class HttpException extends HutoolException { + private static final long serialVersionUID = 1L; + /** + * 构造 + * + * @param e 异常 + */ public HttpException(final Throwable e) { - super(e.getMessage(), e); + super(e); } + /** + * 构造 + * + * @param message 消息 + */ public HttpException(final String message) { super(message); } + /** + * 构造 + * + * @param messageTemplate 消息模板 + * @param params 参数 + */ public HttpException(final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params)); + super(messageTemplate, params); } - public HttpException(final String message, final Throwable throwable) { - super(message, throwable); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + */ + public HttpException(final String message, final Throwable cause) { + super(message, cause); } - public HttpException(final String message, final Throwable throwable, final boolean enableSuppression, final boolean writableStackTrace) { - super(message, throwable, enableSuppression, writableStackTrace); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + * @param enableSuppression 是否启用抑制 + * @param writableStackTrace 堆栈跟踪是否应该是可写的 + */ + public HttpException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); } - public HttpException(final Throwable throwable, final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params), throwable); + /** + * 构造 + * + * @param cause 被包装的子异常 + * @param messageTemplate 消息模板 + * @param params 参数 + */ + public HttpException(final Throwable cause, final String messageTemplate, final Object... params) { + super(cause, messageTemplate, params); } } diff --git a/hutool-http/src/main/java/org/dromara/hutool/http/webservice/SoapRuntimeException.java b/hutool-http/src/main/java/org/dromara/hutool/http/webservice/SoapRuntimeException.java index 9579553e7..9b543170d 100644 --- a/hutool-http/src/main/java/org/dromara/hutool/http/webservice/SoapRuntimeException.java +++ b/hutool-http/src/main/java/org/dromara/hutool/http/webservice/SoapRuntimeException.java @@ -12,33 +12,74 @@ package org.dromara.hutool.http.webservice; -import org.dromara.hutool.core.text.StrUtil; +import org.dromara.hutool.core.exception.HutoolException; /** * SOAP异常 * * @author Looly */ -public class SoapRuntimeException extends RuntimeException { - private static final long serialVersionUID = 8247610319171014183L; +public class SoapRuntimeException extends HutoolException { + private static final long serialVersionUID = 1L; + /** + * 构造 + * + * @param e 异常 + */ public SoapRuntimeException(final Throwable e) { - super(e.getMessage(), e); + super(e); } + /** + * 构造 + * + * @param message 消息 + */ public SoapRuntimeException(final String message) { super(message); } + /** + * 构造 + * + * @param messageTemplate 消息模板 + * @param params 参数 + */ public SoapRuntimeException(final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params)); + super(messageTemplate, params); } - public SoapRuntimeException(final String message, final Throwable throwable) { - super(message, throwable); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + */ + public SoapRuntimeException(final String message, final Throwable cause) { + super(message, cause); } - public SoapRuntimeException(final Throwable throwable, final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params), throwable); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + * @param enableSuppression 是否启用抑制 + * @param writableStackTrace 堆栈跟踪是否应该是可写的 + */ + public SoapRuntimeException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } + + /** + * 构造 + * + * @param cause 被包装的子异常 + * @param messageTemplate 消息模板 + * @param params 参数 + */ + public SoapRuntimeException(final Throwable cause, final String messageTemplate, final Object... params) { + super(cause, messageTemplate, params); } } diff --git a/hutool-json/src/main/java/org/dromara/hutool/json/jwt/JWTException.java b/hutool-json/src/main/java/org/dromara/hutool/json/jwt/JWTException.java index e299fdb6c..2b340c4a9 100644 --- a/hutool-json/src/main/java/org/dromara/hutool/json/jwt/JWTException.java +++ b/hutool-json/src/main/java/org/dromara/hutool/json/jwt/JWTException.java @@ -12,8 +12,7 @@ package org.dromara.hutool.json.jwt; -import org.dromara.hutool.core.exception.ExceptionUtil; -import org.dromara.hutool.core.text.StrUtil; +import org.dromara.hutool.core.exception.HutoolException; /** * JWT异常 @@ -21,30 +20,67 @@ import org.dromara.hutool.core.text.StrUtil; * @author looly * @since 5.7.0 */ -public class JWTException extends RuntimeException { +public class JWTException extends HutoolException { private static final long serialVersionUID = 1L; + /** + * 构造 + * + * @param e 异常 + */ public JWTException(final Throwable e) { - super(ExceptionUtil.getMessage(e), e); + super(e); } + /** + * 构造 + * + * @param message 消息 + */ public JWTException(final String message) { super(message); } + /** + * 构造 + * + * @param messageTemplate 消息模板 + * @param params 参数 + */ public JWTException(final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params)); + super(messageTemplate, params); } + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + */ public JWTException(final String message, final Throwable cause) { super(message, cause); } - public JWTException(final String message, final Throwable throwable, final boolean enableSuppression, final boolean writableStackTrace) { - super(message, throwable, enableSuppression, writableStackTrace); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + * @param enableSuppression 是否启用抑制 + * @param writableStackTrace 堆栈跟踪是否应该是可写的 + */ + public JWTException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); } - public JWTException(final Throwable throwable, final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params), throwable); + /** + * 构造 + * + * @param cause 被包装的子异常 + * @param messageTemplate 消息模板 + * @param params 参数 + */ + public JWTException(final Throwable cause, final String messageTemplate, final Object... params) { + super(cause, messageTemplate, params); } } diff --git a/hutool-poi/src/main/java/org/dromara/hutool/poi/exceptions/POIException.java b/hutool-poi/src/main/java/org/dromara/hutool/poi/exceptions/POIException.java index 83688d58a..47dc1fce9 100644 --- a/hutool-poi/src/main/java/org/dromara/hutool/poi/exceptions/POIException.java +++ b/hutool-poi/src/main/java/org/dromara/hutool/poi/exceptions/POIException.java @@ -12,38 +12,74 @@ package org.dromara.hutool.poi.exceptions; -import org.dromara.hutool.core.exception.ExceptionUtil; -import org.dromara.hutool.core.text.StrUtil; +import org.dromara.hutool.core.exception.HutoolException; /** * POI异常 * * @author Looly */ -public class POIException extends RuntimeException { - private static final long serialVersionUID = 2711633732613506552L; +public class POIException extends HutoolException { + private static final long serialVersionUID = 1L; + /** + * 构造 + * + * @param e 异常 + */ public POIException(final Throwable e) { - super(ExceptionUtil.getMessage(e), e); + super(e); } + /** + * 构造 + * + * @param message 消息 + */ public POIException(final String message) { super(message); } + /** + * 构造 + * + * @param messageTemplate 消息模板 + * @param params 参数 + */ public POIException(final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params)); + super(messageTemplate, params); } - public POIException(final String message, final Throwable throwable) { - super(message, throwable); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + */ + public POIException(final String message, final Throwable cause) { + super(message, cause); } - public POIException(final String message, final Throwable throwable, final boolean enableSuppression, final boolean writableStackTrace) { - super(message, throwable, enableSuppression, writableStackTrace); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + * @param enableSuppression 是否启用抑制 + * @param writableStackTrace 堆栈跟踪是否应该是可写的 + */ + public POIException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); } - public POIException(final Throwable throwable, final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params), throwable); + /** + * 构造 + * + * @param cause 被包装的子异常 + * @param messageTemplate 消息模板 + * @param params 参数 + */ + public POIException(final Throwable cause, final String messageTemplate, final Object... params) { + super(cause, messageTemplate, params); } } diff --git a/hutool-socket/src/main/java/org/dromara/hutool/socket/SocketRuntimeException.java b/hutool-socket/src/main/java/org/dromara/hutool/socket/SocketRuntimeException.java index 3bb8992a4..430d66e03 100644 --- a/hutool-socket/src/main/java/org/dromara/hutool/socket/SocketRuntimeException.java +++ b/hutool-socket/src/main/java/org/dromara/hutool/socket/SocketRuntimeException.java @@ -12,38 +12,74 @@ package org.dromara.hutool.socket; -import org.dromara.hutool.core.exception.ExceptionUtil; -import org.dromara.hutool.core.text.StrUtil; +import org.dromara.hutool.core.exception.HutoolException; /** * Socket异常 * * @author Looly */ -public class SocketRuntimeException extends RuntimeException { - private static final long serialVersionUID = 8247610319171014183L; +public class SocketRuntimeException extends HutoolException { + private static final long serialVersionUID = 1L; + /** + * 构造 + * + * @param e 异常 + */ public SocketRuntimeException(final Throwable e) { - super(ExceptionUtil.getMessage(e), e); + super(e); } + /** + * 构造 + * + * @param message 消息 + */ public SocketRuntimeException(final String message) { super(message); } + /** + * 构造 + * + * @param messageTemplate 消息模板 + * @param params 参数 + */ public SocketRuntimeException(final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params)); + super(messageTemplate, params); } - public SocketRuntimeException(final String message, final Throwable throwable) { - super(message, throwable); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + */ + public SocketRuntimeException(final String message, final Throwable cause) { + super(message, cause); } - public SocketRuntimeException(final String message, final Throwable throwable, final boolean enableSuppression, final boolean writableStackTrace) { - super(message, throwable, enableSuppression, writableStackTrace); + /** + * 构造 + * + * @param message 消息 + * @param cause 被包装的子异常 + * @param enableSuppression 是否启用抑制 + * @param writableStackTrace 堆栈跟踪是否应该是可写的 + */ + public SocketRuntimeException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); } - public SocketRuntimeException(final Throwable throwable, final String messageTemplate, final Object... params) { - super(StrUtil.format(messageTemplate, params), throwable); + /** + * 构造 + * + * @param cause 被包装的子异常 + * @param messageTemplate 消息模板 + * @param params 参数 + */ + public SocketRuntimeException(final Throwable cause, final String messageTemplate, final Object... params) { + super(cause, messageTemplate, params); } }