This method rethrows input throwable as is (if its unchecked) or wraps it with RuntimeException and throws. The typical usage would be throw throwAsRuntime(...), where throw statement is needed so Java compiler knows the execution stops at that line. @param throwable inp
(Throwable throwable)
| 1052 | * @return the method never returns, it always throws an unchecked exception |
| 1053 | */ |
| 1054 | @API(since = "1.26", status = API.Status.EXPERIMENTAL) |
| 1055 | public static RuntimeException throwAsRuntime(Throwable throwable) { |
| 1056 | Throwables.throwIfUnchecked(throwable); |
| 1057 | throw new RuntimeException(throwable); |
| 1058 | } |
| 1059 | |
| 1060 | /** |
| 1061 | * This method rethrows input throwable as is (if its unchecked) with an extra |