public abstract class ExceptionHandler extends Object
The developer can return a new exception which replaces the original one or return the one that was thrown by the operation. For example, wrapping the Exception into a ConnectionException, the runtime know that reconnection is needed. Notice that this implies that the method should not fail by any reason.
| Constructor and Description |
|---|
ExceptionHandler() |
| Modifier and Type | Method and Description |
|---|---|
abstract Exception |
enrichException(Exception e)
This method can return a new enriched exception or the original exception
after doing some processing with it.
|
protected Exception |
getRootErrorException(Exception exception)
This method instrospects the given
exception looking for the deepest ErrorTypeDefinition in the causes. |
public abstract Exception enrichException(Exception e)
e - the exception thrown by the operationprotected Exception getRootErrorException(Exception exception)
exception looking for the deepest ErrorTypeDefinition in the causes.
Returns a a new ModuleException that wraps the exception received as parameter with the ErrorTypeDefinition
found.exception - to introspectModuleException with the innermost ErrorTypeDefinition found.Copyright © 2017 MuleSoft, Inc.. All rights reserved.