Returns cause of the given throwable if it is non-null or the throwable itself. @param throwable input throwable @return cause of the given throwable if it is non-null or the throwable itself
(Throwable throwable)
| 1106 | * @return cause of the given throwable if it is non-null or the throwable itself |
| 1107 | */ |
| 1108 | @API(since = "1.26", status = API.Status.EXPERIMENTAL) |
| 1109 | public static Throwable causeOrSelf(Throwable throwable) { |
| 1110 | Throwable cause = throwable.getCause(); |
| 1111 | return cause != null ? cause : throwable; |
| 1112 | } |
| 1113 | |
| 1114 | /** |
| 1115 | * Retrieves messages in a exception and writes them to a string. In the |
no test coverage detected