List of usage examples for com.google.common.util.concurrent UncheckedExecutionException setStackTrace
public void setStackTrace(StackTraceElement[] stackTrace)
From source file:org.jclouds.rest.internal.BlockOnFuture.java
private static RuntimeException propagateCause(Exception e) { Throwable cause = e.getCause(); if (cause == null) { UncheckedExecutionException unchecked = new UncheckedExecutionException(e.getMessage()) { private static final long serialVersionUID = 1L; };//w w w . j a v a2s. c om unchecked.setStackTrace(e.getStackTrace()); throw unchecked; } StackTraceElement[] combined = concat(cause.getStackTrace(), e.getStackTrace(), StackTraceElement.class); cause.setStackTrace(combined); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } if (cause instanceof Error) { throw (Error) cause; } // The cause is a weird kind of Throwable, so throw the outer exception. throw new RuntimeException(e); }