public class Exceptions extends Object
| Constructor and Description |
|---|
Exceptions() |
| Modifier and Type | Method and Description |
|---|---|
static RuntimeException |
runtime(Throwable t)
Convert the argument to a
RuntimeException so it can be thrown. |
static RuntimeException |
runtime(Throwable t,
String message)
Convert the argument to a
RuntimeException so it can be thrown. |
public static RuntimeException runtime(Throwable t)
RuntimeException so it can be thrown.
Error then rethrow it immediately.t - message - public static RuntimeException runtime(Throwable t, String message)
RuntimeException so it can be thrown.
Error then rethrow it immediately.try {
// do something
} catch(Throwable t) {
throw Exceptions.runtime(t, "It didn't work.");
}
t - message - Copyright © 2014. All rights reserved.