Java EE 5 SDK

com.sun.appserv.management.util.misc
Class ExceptionUtil

java.lang.Object
  extended by com.sun.appserv.management.util.misc.ExceptionUtil

public final class ExceptionUtil
extends Object

Useful utilities for Exceptions


Method Summary
static Throwable[] getCauses(Throwable start)
          Get the chain of exceptions via getCause().
static Throwable getRootCause(Throwable e)
          Get the original troublemaker.
static String getStackTrace(Throwable t)
          Get the stack trace as a String.
static String toString(Throwable t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toString

public static String toString(Throwable t)

getCauses

public static Throwable[] getCauses(Throwable start)
Get the chain of exceptions via getCause(). The first element is the Exception passed.

Parameters:
start - the Exception to traverse
Returns:
a Throwable[] or an Exception[] as appropriate

getRootCause

public static Throwable getRootCause(Throwable e)
Get the original troublemaker.

Parameters:
e - the Exception to dig into
Returns:
the original Throwable that started the problem

getStackTrace

public static String getStackTrace(Throwable t)
Get the stack trace as a String.

Parameters:
t - the Throwabe whose stack trace should be gotten
Returns:
a String containing the stack trace

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.