Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.common.utils
Class ExceptionUtils

java.lang.Object
  extended by org.nuxeo.common.utils.ExceptionUtils

public final class ExceptionUtils
extends Object

Provides utility methods for manipulating and examining exceptions in a generic way.

Author:
DM

Method Summary
static Throwable getRootCause(Throwable throwable)
          Gets the root cause of the given Throwable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRootCause

public static Throwable getRootCause(Throwable throwable)
Gets the root cause of the given Throwable.

This method walks through the exception chain up to the root of the exceptions tree using Throwable.getCause(), and returns the root exception.

Parameters:
throwable - the throwable to get the root cause for, may be null - this is to avoid throwing other un-interesting exception when handling a business-important exception
Returns:
the root cause of the Throwable, null if none found or null throwable input

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.