Mercurial Hosting > nabble
view src/fschmidt/util/java/ComputationException.java @ 69:4bc1fc540265 default tip
update luan
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 05 Oct 2025 20:45:39 -0600 |
parents | 00520880ad02 |
children |
line wrap: on
line source
package fschmidt.util.java; import java.util.concurrent.ExecutionException; public final class ComputationException extends RuntimeException { public ComputationException(Exception e) { super(e); } public static ComputationException newInstance(ExecutionException e) { Throwable cause = e.getCause(); if( cause instanceof Error ) throw (Error)cause; if( cause instanceof RuntimeException ) throw (RuntimeException)cause; if( cause instanceof Exception ) return new ComputationException((Exception)cause); return new ComputationException(e); } }