public static <X extends Throwable> RuntimeException rethrowUnwrap(Throwable t, Class<X> exceptionClass) throws X { Throwable t1 = unwrap(t); if (exceptionClass.isInstance(t1)) throw exceptionClass.cast(t1); throw rethrow(t1); }
public static <X1 extends Throwable, X2 extends Throwable> RuntimeException rethrowUnwrap(Throwable t, Class<X1> exceptionClass1, Class<X2> exceptionClass2) throws X1, X2 { Throwable t1 = unwrap(t); if (exceptionClass1.isInstance(t1)) throw exceptionClass1.cast(t1); if (exceptionClass2.isInstance(t1)) throw exceptionClass2.cast(t1); throw rethrow(t1); }
public static <X extends Throwable> RuntimeException rethrowUnwrap(Throwable t, Class<X> exceptionClass) throws X { Throwable t1 = unwrap(t); if (exceptionClass.isInstance(t1)) throw exceptionClass.cast(t1); throw rethrow(t1); }
private static <V, X extends Exception> RuntimeException throwChecked(ExecutionException ex, Class<X> exceptionType) throws X { Throwable t = Exceptions.unwrap(ex); if (exceptionType.isInstance(t)) throw exceptionType.cast(t); else throw Exceptions.rethrow(t); }
public static <X1 extends Throwable, X2 extends Throwable> RuntimeException rethrowUnwrap(Throwable t, Class<X1> exceptionClass1, Class<X2> exceptionClass2) throws X1, X2 { Throwable t1 = unwrap(t); if (exceptionClass1.isInstance(t1)) throw exceptionClass1.cast(t1); if (exceptionClass2.isInstance(t1)) throw exceptionClass2.cast(t1); throw rethrow(t1); }
public static RuntimeException rethrowUnwrap(Throwable t) { throw rethrow(unwrap(t)); }
public static RuntimeException rethrowUnwrap(Throwable t) { throw rethrow(unwrap(t)); }
@Override public void uncaughtException(Strand s, Throwable e) { System.err.print("Exception in Fiber \"" + s.getName() + "\" "); if (e instanceof NullPointerException || e instanceof ClassCastException || Exceptions.unwrap(e) instanceof NullPointerException || Exceptions.unwrap(e) instanceof ClassCastException) System.err.println("If this exception looks strange, perhaps you've forgotten to instrument a blocking method. Run your program with -Dco.paralleluniverse.fibers.verifyInstrumentation to catch the culprit!"); System.err.println(e); Strand.printStackTrace(threadToFiberStack(e.getStackTrace()), System.err); checkInstrumentation(ExtendedStackTrace.of(e), true); } };