Java org.apache.commons.lang3.exception ExceptionUtils fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.lang3.exception ExceptionUtils fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.lang3.exception ExceptionUtils.

The text is from its open source code.

Subclass

org.apache.commons.lang3.exception.ExceptionUtils has subclasses.
Click this link to see all its subclasses.

Method

ThrowablegetCause(final Throwable throwable)

Introspects the Throwable to obtain the cause.

The method searches for methods with specific names that return a Throwable object.

StringgetMessage(final Throwable th)
Gets a short message summarising the exception.
ThrowablegetRootCause(final Throwable throwable)

Introspects the Throwable to obtain the root cause.

This method walks through the exception chain to the last element, "root" of the tree, using #getCause(Throwable) , and returns that exception.

From version 2.2, this method handles recursive cause structures that might otherwise cause infinite loops.

StringgetRootCauseMessage(final Throwable th)
Gets a short message summarising the root cause exception.
String[]getRootCauseStackTrace(final Throwable throwable)

Creates a compact stack trace for the root cause of the supplied Throwable.

The output of this method is consistent across JDK versions.

String[]getStackFrames(final Throwable throwable)

Captures the stack trace associated with the specified Throwable object, decomposing it into a list of stack frames.

The result of this method vary by JDK version as this method uses Throwable#printStackTrace(java.io.PrintWriter) .

String[]getStackFrames(final String stackTrace)

Returns an array where each element is a line from the argument.

The end of line is determined by the value of SystemUtils#LINE_SEPARATOR .

StringgetStackTrace(final Throwable throwable)

Gets the stack trace from a Throwable as a String.

The result of this method vary by JDK version as this method uses Throwable#printStackTrace(java.io.PrintWriter) .

intgetThrowableCount(final Throwable throwable)

Counts the number of Throwable objects in the exception chain.

A throwable without cause will return 1.

ListgetThrowableList(Throwable throwable)

Returns the list of Throwable objects in the exception chain.

A throwable without cause will return a list containing one element - the input throwable.

Throwable[]getThrowables(final Throwable throwable)

Returns the list of Throwable objects in the exception chain.

A throwable without cause will return an array containing one element - the input throwable.

intindexOfThrowable(final Throwable throwable, final Class clazz)

Returns the (zero based) index of the first Throwable that matches the specified class (exactly) in the exception chain.

intindexOfType(final Throwable throwable, final Class type)

Returns the (zero based) index of the first Throwable that matches the specified class or subclass in the exception chain.

voidprintRootCauseStackTrace(final Throwable throwable)

Prints a compact stack trace for the root cause of a throwable to System.err.

The compact stack trace starts with the root cause and prints stack frames up to the place where it was caught and wrapped.

voidprintRootCauseStackTrace(final Throwable throwable, final PrintStream stream)

Prints a compact stack trace for the root cause of a throwable.

The compact stack trace starts with the root cause and prints stack frames up to the place where it was caught and wrapped.

voidprintRootCauseStackTrace(final Throwable throwable, final PrintWriter writer)

Prints a compact stack trace for the root cause of a throwable.

The compact stack trace starts with the root cause and prints stack frames up to the place where it was caught and wrapped.