org.apache.xmlbeans.impl.util

## Class ExceptionUtil

- java.lang.Object
- - org.apache.xmlbeans.impl.util.ExceptionUtil

-     public class ExceptionUtil
      extends Object

  Utility methods for dealing with exceptions/throwables
  Since:
    5.2.0

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `isFatal(Throwable throwable)` It is important never to catch all `Throwable`s.
    `static void` | `rethrow(Throwable throwable)` Designed to be used in conjunction with `isFatal(Throwable)`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### isFatal

          public static boolean isFatal(Throwable throwable)

      It is important never to catch all `Throwable`s. Some like `InterruptedException` should be rethrown. Based on scala.util.control.NonFatal.
      Parameters:
        `throwable` - to check
      Returns:
        whether the `Throwable` is a fatal error

    - #### rethrow

          public static void rethrow(Throwable throwable)

      Designed to be used in conjunction with `isFatal(Throwable)`. This method should be used with care.

      The input throwable is thrown if it is an `Error` or a `RuntimeException`. Otherwise, the method wraps the throwable in a RuntimeException and rethrows that.

      Parameters:
        `throwable` - to check