Casts or wraps the given exception to be a RuntimeException.
432110
public static RuntimeException asRuntime(Throwable e) {
		if (e instanceof RuntimeException) {
			return (RuntimeException) e;
		} else {
			return new WrappedAsRuntimeException(e);
		}
	}
298688
public static RuntimeException bubble(Throwable t) {

        if (t instanceof ExecutionException) {
            return bubble(t.getCause());
        }

        if (t instanceof TimeoutException) {
            return new RedisCommandTimeoutException(t);
        }

        if (t instanceof InterruptedException) {

            Thread.currentThread().interrupt();
            return new RedisCommandInterruptedException(t);
        }

        if (t instanceof RedisException) {
            return (RedisException) t;
        }

        return new RedisException(t);
    }
906400
private RuntimeException unpackExecutionException(Throwable exc) {
    while (exc instanceof ExecutionException || exc instanceof UncheckedExecutionException) {
      exc = exc.getCause();
    }
    return Throwables.propagate(exc);
  }
630418
public static void rethrowException(Throwable t) throws Exception {
		if (t instanceof Error) {
			throw (Error) t;
		}
		else if (t instanceof Exception) {
			throw (Exception) t;
		}
		else {
			throw new Exception(t.getMessage(), t);
		}
	}
278019
protected void throwException() throws InterruptedException, IOException {

        if (this.exception instanceof IOException) {
            throw (IOException) this.exception;
        }
        if (this.exception instanceof InterruptedException) {
            throw (InterruptedException) this.exception;
        }
        if (this.exception instanceof RuntimeException) {
            throw (RuntimeException) this.exception;
        }
        throw new RuntimeException(this.exception);
    }
457989
private Throwable wrapCancellationException(Throwable u) {
        Throwable wrappedException = null;
        if (u != null) {
            wrappedException = Exceptions.unwrap(u);
            if (wrappedException instanceof CancellationException) {
                wrappedException = new ReadCancellationException(wrappedException);
            }
        }
        return wrappedException;
    }
779518
public static RuntimeException convertReflectionExceptionToUnchecked(Exception e) {
		if ((e instanceof IllegalAccessException) || (e instanceof NoSuchMethodException)) {
			return new IllegalArgumentException(e);
		} else if (e instanceof InvocationTargetException) {
			return new RuntimeException(((InvocationTargetException) e).getTargetException());
		} else if (e instanceof RuntimeException) {
			return (RuntimeException) e;
		}
		return new UncheckedException(e);
	}
1287659
def exception_wrapper(f):
    """"""
    @wraps(f)
    def wrapper(*args, **kwds):
        try:
            return f(*args, **kwds)
        except dbus.exceptions.DBusException as err:
            _args = err.args
            raise PyMPRISException(*_args)
    return wrapper
790537
public static KbRuntimeException fromThrowable(Throwable cause) {
    return (cause instanceof KbRuntimeException)
                   ? (KbRuntimeException) cause
                   : new KbRuntimeException(cause);
  }
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);
  }
788366
public static void throwException(Throwable t) {
        if (hasUnsafe()) {
            PlatformDependent0.throwException(t);
        } else {
            PlatformDependent.<RuntimeException>throwException0(t);
        }
    }
981153
public static void throwChecked(Throwable t) {
    if (t == null) {
      throw new AssertionError("null");
    }
    Exceptions.<RuntimeException>throwIt(t);
  }
994268
public static RuntimeException asRuntimeException(Exception e) {
        if (e instanceof RuntimeException) {
            return (RuntimeException) e;
        }
        return UnexpectedMethodInvocationException.triage(e);
    }
398214
def exception(self, *args, **kwargs):
        """"""
        kwargs['api'] = self.api
        return exception(*args, **kwargs)
1140215
private static <E extends RuntimeException> E handleException(E ex) {
        if (JodaTime.hasExpectedBehavior())
            return ex;
        throw new IllegalStateException("Joda-time 2.2 or later version is required, but found version: " + JodaTime.getVersion(), ex);
    }
395126
def make_exception(method, e):
    """"""
    x = e.details()
    name = x[:x.find(':')].split('.')[-1]
    if name in globals():
        cls = globals()[name]
    else:
        cls = UnknownRpcException  # noqa

    return cls(method, e.code(), e.details())
382416
public static void logRuntimeException(Logger log, String exceptionMessage,
            String method, Object... params) {
        handleException(log, newRunTimeException(exceptionMessage), method,
                params);
    }