Class Throwables

java.lang.Object
org.fest.reflect.util.Throwables

public final class Throwables extends Object
Understands utility methods related to Throwables.
Since:
1.2
Author:
Alex Ruiz
  • Method Details

    • targetOf

      public static Throwable targetOf(Throwable t)
      Obtains the target of the given Throwable. If the Throwable is a InvocationTargetException, this method will return the "target exception" (not the cause.) For other Throwables, the same instance is returned unmodified.
      Parameters:
      t - the given Throwable.
      Returns:
      the target exception, if applicable. Otherwise, this method returns the same Throwable passed as argument.