org.apache.cocoon.sitemap.util
Class ExceptionHandler

java.lang.Object
  extended by org.apache.cocoon.sitemap.util.ExceptionHandler

public class ExceptionHandler
extends Object


Constructor Summary
ExceptionHandler()
           
 
Method Summary
static Throwable getCause(Throwable throwable)
          Get the underlying cause of the given exception.
static InvocationException getInvocationException(Throwable throwable)
          Wraps the given throwable into an InvocationException, if that is necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHandler

public ExceptionHandler()
Method Detail

getInvocationException

public static InvocationException getInvocationException(Throwable throwable)
Wraps the given throwable into an InvocationException, if that is necessary.

If the given throwable is already an instance of InvocationException, the given throwable is returned.

Parameters:
throwable - The throwable to wrap inside an InvocationException.
Returns:
The (possibly) wrapped throwable.

getCause

public static Throwable getCause(Throwable throwable)
Get the underlying cause of the given exception.

Technically this unwraps the given exception until one of the following happens
This method will return null if and only if the given exception is null.

Parameters:
throwable - The Throwable to get the cause for.
Returns:
The underlying cause.


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.