
pro.jk.ejoker.common.system.task.io.IOExceptionOnRuntime Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ejoker-common Show documentation
Show all versions of ejoker-common Show documentation
EJoker is a CQRS + EventSourcing framwork
package pro.jk.ejoker.common.system.task.io;
import java.io.IOException;
/**
* Because IOExceotion must catch in jvm, we use a new class extend RuntimeException instant of it.
* @author kimffy
*
*/
public class IOExceptionOnRuntime extends RuntimeException {
private static final long serialVersionUID = -6136575737998929097L;
public IOExceptionOnRuntime(IOException cause) {
super(cause);
}
public IOExceptionOnRuntime(String message, IOException cause) {
super(message, cause);
}
public IOExceptionOnRuntime(String message, IOException cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
/**
* make any exception as RuntimeIOException
* @param e
* @return
*/
public final static IOExceptionOnRuntime encapsulation(Throwable e) {
if(e instanceof IOException)
return new IOExceptionOnRuntime((IOException )e);
else {
return new IOExceptionOnRuntime(new IOException(e.getMessage(), e));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy