Cancels a call, and throws the exception.

@param t must be a RuntimeException or Error
971038
private static RuntimeException cancelThrow(ClientCall<?, ?> call, Throwable t) {
    try {
      call.cancel(null, t);
    } catch (Throwable e) {
      assert e instanceof RuntimeException || e instanceof Error;
      logger.log(Level.SEVERE, "RuntimeException encountered while closing call", e);
    }
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else if (t instanceof Error) {
      throw (Error) t;
    }
    // should be impossible
    throw new AssertionError(t);
  }
1370564
public synchronized void cancel() // d583637
    {
        ivIsCanceled = true;
        stopAlarm();

        // F743-33394 - Wait for the sweep to finish.
        while (ivIsRunning) {
            try {
                wait();
            } catch (InterruptedException ex) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "interrupted", ex);
                Thread.currentThread().interrupt();
            }
        }

        ivActivator = null;
    }
120170
public static void throwRuntimeException(Throwable t)
    {
        // Unchecked? Can re-throw as is
        throwIfUnchecked(t);
        // Otherwise, let's just change its type:
        throw new RuntimeException("[was "+t.getClass()+"] "+t.getMessage(), t);
    }
106578
private void reportException(int s) {
        Throwable ex = ((s == CANCELLED) ?  new CancellationException() :
                        (s == EXCEPTIONAL) ? getThrowableException() :
                        null);
        if (ex != null)
            U.throwException(ex);
    }
946732
private void setLogicalCloseException(final Throwable t) {

      if(logicalCloseException == null) {
         logicalCloseException = t;
      } else if(!Util.isRuntimeError(logicalCloseException) && Util.isRuntimeError(t)) {
         logicalCloseException = t;
      }
   }
1350517
protected void checkError() throws IOException {
		final Throwable t = cause.get();

		if (t != null) {
			if (t instanceof CancelTaskException) {
				throw (CancelTaskException) t;
			}
			if (t instanceof IOException) {
				throw (IOException) t;
			}
			else {
				throw new IOException(t);
			}
		}
	}
828036
public static RuntimeException propagate(Throwable t) {
        if (t instanceof RuntimeException) {
            throw (RuntimeException) t;
        } else {
            throw new RuntimeException(t);
        }
    }
1263784
public static void exception(TraceComponent tc, Exception e) {
    if(isTracing()) SibTr.exception(tc, e);

  }
396728
@Private
  @Override
  public void threwException(final int taskletId, final Exception exception) {
    try {
      failedTasklets(exception, Collections.singletonList(taskletId));
    } catch (final InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
128410
static final void cancelIgnoringExceptions(ForkJoinTask<?> t) {
        if (t != null && t.status >= 0) {
            try {
                t.cancel(false);
            } catch (Throwable ignore) {
            }
        }
    }
1255342
public static void w(String s, Throwable t) {
		log(Level.WARNING, s, t);
	}
477738
def cancel(self, caller):
        
        for o in {i for i in self.children if isinstance(i, AbstractCallable)}:
            o.cancel(caller)
1250825
public static <TResult> Task<TResult> call(final Callable<TResult> callable, Executor executor,
      final CancellationToken ct) {
    final bolts.TaskCompletionSource<TResult> tcs = new bolts.TaskCompletionSource<>();
    try {
      executor.execute(new Runnable() {
        @Override
        public void run() {
          if (ct != null && ct.isCancellationRequested()) {
            tcs.setCancelled();
            return;
          }

          try {
            tcs.setResult(callable.call());
          } catch (CancellationException e) {
            tcs.setCancelled();
          } catch (Exception e) {
            tcs.setError(e);
          }
        }
      });
    } catch (Exception e) {
      tcs.setError(new ExecutorException(e));
    }

    return tcs.getTask();
  }
1009406
public void onError(Throwable cause) {
    if (cause instanceof StatusRuntimeException
        && ((StatusRuntimeException) cause).getStatus().getCode() == Status.Code.CANCELLED) {
      // Cancellation is already handled.
      return;
    }
    mSerializingExecutor.execute(() -> {
      LogUtils.warnWithException(LOG, "Exception thrown while handling write request {}",
          mContext == null ? "unknown" : mContext.getRequest(), cause);
      abort(new Error(AlluxioStatusException.fromThrowable(cause), false));
    });
  }
483619
public void exceptionOccured( Throwable t )
    {
        if (!isIgnored() && expectation.meets( t ))
        {
            actual = t;
        }
        else
        {
            exception = t;
        }
    }
216275
public <T> T execute(final Callable<T> callable) throws Exception {
        int attempts = 0;
        int maxAttempts = retryPolicy.getMaxAttempts();
        long delay = retryPolicy.getDelay();
        TimeUnit timeUnit = retryPolicy.getTimeUnit();
        while(attempts < maxAttempts) {
            try {
                attempts++;
                beforeCall();
                T result = callable.call();
                afterCall(result);
                return result;
            } catch (Exception e) {
                onException(e);
                if (attempts >= maxAttempts) {
                    onMaxAttempts(e);
                    throw e;
                }
                beforeWait();
                sleep(timeUnit.toMillis(delay));
                afterWait();
            }
        }
        return null;
    }
1150351
protected void log( Throwable t )
  {
    if( _logger == null )
    {
      t.printStackTrace();
    }
    else
    {
      _logger.warn( "Error running job.", t );
    }
  }