org.apache.maven.doxia.util

Class WrappedException


public abstract class WrappedException
extends Exception

Base class for exceptions which are wrappers around other exceptions. This type of exception keep a record of the original exception, that is, the one which was used to actually report a problem.

Constructor Summary

WrappedException()
Constructs an exception with no original exception and no detail message.
WrappedException(Exception e)
Constucts an exception with an original exception but no detail message.
WrappedException(Exception e, String message)
Constucts an exception with both an original exception and an detail message.
WrappedException(String message)
Constructs an exception with a detail message but no original exception.

Method Summary

Exception
getRootException()
Returns the original exception.

Constructor Details

WrappedException

public WrappedException()
Constructs an exception with no original exception and no detail message.

WrappedException

public WrappedException(Exception e)
Constucts an exception with an original exception but no detail message.
Parameters:
e - the original exception

WrappedException

public WrappedException(Exception e,
                        String message)
Constucts an exception with both an original exception and an detail message.
Parameters:
e - the original exception
message - the detail message; if null, the detail message of the original exception if any is used instead (it is this message which is returned by java.lang.Throwable.getMessage)

WrappedException

public WrappedException(String message)
Constructs an exception with a detail message but no original exception.
Parameters:
message - the detail message

Method Details

getRootException

public Exception getRootException()
Returns the original exception.
Returns:
the original exception if any or null otherwise