Wraps an exception with RuntimeException and return it. If the exception is already an instance of RuntimeException, returns it directly.
(Exception e)
| 1090 | * returns it directly. |
| 1091 | */ |
| 1092 | public static RuntimeException toUnchecked(Exception e) { |
| 1093 | if (e instanceof RuntimeException) { |
| 1094 | return (RuntimeException) e; |
| 1095 | } |
| 1096 | if (e instanceof IOException) { |
| 1097 | return new UncheckedIOException((IOException) e); |
| 1098 | } |
| 1099 | return new RuntimeException(e); |
| 1100 | } |
| 1101 | |
| 1102 | /** |
| 1103 | * Returns cause of the given throwable if it is non-null or the throwable itself. |
no outgoing calls
no test coverage detected