This commit is contained in:
Looly
2023-04-27 00:41:59 +08:00
parent 49a6611ae8
commit edbd5140aa
9 changed files with 331 additions and 213 deletions

View File

@@ -12,7 +12,6 @@
package org.dromara.hutool.core.io;
import org.dromara.hutool.core.exception.ExceptionUtil;
import org.dromara.hutool.core.text.StrUtil;
/**
@@ -23,24 +22,72 @@ import org.dromara.hutool.core.text.StrUtil;
public class IORuntimeException extends RuntimeException {
private static final long serialVersionUID = 8247610319171014183L;
public IORuntimeException(final Throwable e) {
super(ExceptionUtil.getMessage(e), e);
/**
* 构造
*/
public IORuntimeException() {
super();
}
/**
* 构造
*
* @param e 异常
*/
public IORuntimeException(final Throwable e) {
super(e);
}
/**
* 构造
*
* @param message 消息
*/
public IORuntimeException(final String message) {
super(message);
}
/**
* 构造
*
* @param messageTemplate 消息模板
* @param params 参数
*/
public IORuntimeException(final String messageTemplate, final Object... params) {
super(StrUtil.format(messageTemplate, params));
}
public IORuntimeException(final String message, final Throwable throwable) {
super(message, throwable);
/**
* 构造
*
* @param message 消息
* @param cause 被包装的子异常
*/
public IORuntimeException(final String message, final Throwable cause) {
super(message, cause);
}
public IORuntimeException(final Throwable throwable, final String messageTemplate, final Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
/**
* 构造
*
* @param message 消息
* @param cause 被包装的子异常
* @param enableSuppression 是否启用抑制
* @param writableStackTrace 堆栈跟踪是否应该是可写的
*/
public IORuntimeException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
/**
* 构造
*
* @param cause 被包装的子异常
* @param messageTemplate 消息模板
* @param params 参数
*/
public IORuntimeException(final Throwable cause, final String messageTemplate, final Object... params) {
super(StrUtil.format(messageTemplate, params), cause);
}
/**