public class

Throwables

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.base.Throwables

Class Overview

Utility methods for throwables (errors, exceptions, runtime exceptions).

Summary

Nested Classes
class Throwables.ThrowableFormatter  
Public Constructors
Throwables()
Public Methods
static String formatStacktrace(Throwable t)
Generate the standard formatting of a throwable as a multi-line, human-readable stacktrace.
static String formatStacktraceAlt(Throwable t)
This convenience method uses Throwables.ThrowableFormatter to format a stacktrace.
static String formatStacktraceShort(Throwable t)
Format a throwable as a one-line, human-readable stacktrace.
static Throwable getRootCause(Throwable t)
Get the innermost cause of a throwable.
static void rethrowUnchecked(Throwable t)
Rethrow a throwable if it is a RuntimeException, else wrap it in a RuntimeException and throw.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Throwables ()

Public Methods

public static String formatStacktrace (Throwable t)

Generate the standard formatting of a throwable as a multi-line, human-readable stacktrace.

public static String formatStacktraceAlt (Throwable t)

This convenience method uses Throwables.ThrowableFormatter to format a stacktrace. Suppressed exceptions are not printed out. Exception tokens are safely escaped.

public static String formatStacktraceShort (Throwable t)

Format a throwable as a one-line, human-readable stacktrace.

public static Throwable getRootCause (Throwable t)

Get the innermost cause of a throwable.

public static void rethrowUnchecked (Throwable t)

Rethrow a throwable if it is a RuntimeException, else wrap it in a RuntimeException and throw.