ExceptionUtils (Apache Tomcat 8.5.55 API Documentation)

org.apache.tomcat.util

## Class ExceptionUtils

- java.lang.Object
- - org.apache.tomcat.util.ExceptionUtils

-     public class ExceptionUtils
      extends Object

  Utilities for handling Throwables and Exceptions.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExceptionUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `handleThrowable(Throwable t)` Checks whether the supplied Throwable is one that needs to be rethrown and swallows all others.
    `static void` | `preload()` NO-OP method provided to enable simple pre-loading of this class.
    `static Throwable` | `unwrapInvocationTargetException(Throwable t)` Checks whether the supplied Throwable is an instance of `InvocationTargetException` and returns the throwable that is wrapped by it, if there is any.

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

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

- - ### Constructor Detail

    - #### ExceptionUtils

          public ExceptionUtils()

  - ### Method Detail

    - #### handleThrowable

          public static void handleThrowable(Throwable t)

      Checks whether the supplied Throwable is one that needs to be rethrown and swallows all others.
      Parameters:
        `t` - the Throwable to check

    - #### unwrapInvocationTargetException

          public static Throwable unwrapInvocationTargetException(Throwable t)

      Checks whether the supplied Throwable is an instance of `InvocationTargetException` and returns the throwable that is wrapped by it, if there is any.
      Parameters:
        `t` - the Throwable to check
      Returns:
        `t` or `t.getCause()`

    - #### preload

          public static void preload()

      NO-OP method provided to enable simple pre-loading of this class. Since the class is used extensively in error handling, it is prudent to pre-load it to avoid any failure to load this class masking the true problem during error handling.

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.