
com.star.exception.TableException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils Show documentation
Show all versions of utils Show documentation
some utility class for java develop
The newest version!
package com.star.exception;
import com.star.string.StringUtil;
/**
* 包装io异常
*
* @author xiaoleilu
*/
public class TableException extends RuntimeException {
public TableException(Throwable e) {
super(ExceptionUtil.getMessage(e), e);
}
public TableException(String message) {
super(message);
}
public TableException(String messageTemplate, Object... params) {
super(StringUtil.format(messageTemplate, params));
}
public TableException(String message, Throwable throwable) {
super(message, throwable);
}
public TableException(Throwable throwable, String messageTemplate, Object... params) {
super(StringUtil.format(messageTemplate, params), throwable);
}
/**
* 导致这个异常的异常是否是指定类型的异常
*
* @param clazz 异常类
* @return 是否为指定类型异常
*/
public boolean causeInstanceOf(Class extends Throwable> clazz) {
Throwable cause = this.getCause();
return null != cause && clazz.isInstance(cause);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy