org.nuxeo.common.utils
Class ExceptionUtils
java.lang.Object
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
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
Copyright © 2011 Nuxeo SAS. All Rights Reserved.