exceptioins包下有四个类,
exceptioins包下异常类类图如下(按类型划分)
ExceptionFactory 类,是生产Exception的工厂类
public class ExceptionFactory {
private ExceptionFactory() {
// Prevent Instantiation
}
public static RuntimeException wrapException(String message, Exception e) {
return new PersistenceException(ErrorContext.instance().message(message).cause(e).toString(), e);
}
}
可以看出ExceptionFactory 的构造函数使用private修饰,不能实例化该类,
wrapException 静态函数