ExceptionUtils (Apache Tomcat 11.0.23 API Documentation)
Description: declaration: package: org.apache.jasper.runtime, class: ExceptionUtils

# Class ExceptionUtils

java.lang.Object
org.apache.jasper.runtime.ExceptionUtils

public class ExceptionUtils extends Object
Utilities for handling Throwables and Exceptions.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ExceptionUtils()`
  Default constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `handleThrowable(Throwable t)`
  Checks whether the supplied Throwable is one that needs to be rethrown and swallows all others.
  `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 Object

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

- ## Constructor Details

  - ### ExceptionUtils

    public ExceptionUtils()
    Default constructor. This class is not intended to be instantiated.

- ## Method Details

  - ### 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()`