public final class ExceptionHelper extends Object
ExceptionHelper
provides a number of helper functions that can be
useful for dealing with Mule exceptions. This class has 3 core functions - 1.
ErrorCode lookup. A corresponding Mule error code can be found using for a given
Mule exception 2. Addtional Error information such as Java doc url for a given
exception can be resolved using this class 3. Error code mappings can be looked up
by providing the the protocol to map to and the Mule exception.Modifier and Type | Field and Description |
---|---|
static String |
APPLY_TO_PROPERTY
a comma-separated list of other protocols the mappings in a file can be
applied to
|
static String |
ERROR_CODE_PROPERTY
This is the property to set the error code to no the message it is the
property name the Transport provider uses set the set the error code on the
underlying message
|
protected static org.apache.commons.logging.Log |
logger
logger used by this class
|
Modifier and Type | Method and Description |
---|---|
static String |
getDocUrl(Class exception) |
static Class |
getErrorClass(int code) |
static int |
getErrorCode(Class exception) |
static String |
getErrorCodePropertyName(String protocol) |
static String |
getErrorMapping(String protocol,
Class exception) |
static Map |
getExceptionInfo(Throwable t) |
static ExceptionReader |
getExceptionReader(Throwable t)
Gets an exception reader for the exception
|
static List |
getExceptionsAsList(Throwable t) |
static String |
getExceptionStack(Throwable t) |
static String |
getJavaDocUrl(Class exception) |
static Throwable |
getRootException(Throwable t) |
static MuleException |
getRootMuleException(Throwable t) |
static Throwable |
getRootParentException(Throwable t) |
static void |
registerExceptionReader(ExceptionReader reader)
Registers an exception reader with Mule
|
static String |
writeException(Throwable t) |
public static final String ERROR_CODE_PROPERTY
public static final String APPLY_TO_PROPERTY
protected static final org.apache.commons.logging.Log logger
public static int getErrorCode(Class exception)
public static Class getErrorClass(int code)
public static MuleException getRootMuleException(Throwable t)
public static void registerExceptionReader(ExceptionReader reader)
reader
- the reader to register.public static ExceptionReader getExceptionReader(Throwable t)
t
- the exception to get a reader forCopyright © 2003–2013 MuleSource, Inc.. All rights reserved.