public final class ExceptionMapper extends Object
ErrorType
that must be used when an Exception
is thrown by a mule component.
To create instances of ExceptionMapper
you must use the builder()
method.Modifier and Type | Class and Description |
---|---|
static class |
ExceptionMapper.Builder
Builder to create instances of
ExceptionMapper |
Modifier and Type | Method and Description |
---|---|
static ExceptionMapper.Builder |
builder() |
Optional<ErrorType> |
resolveErrorType(Class<? extends Throwable> exceptionType)
Using the set of
ExceptionMapping s which this instance was configured with, it resolves the ErrorType
associated with the exception. |
public Optional<ErrorType> resolveErrorType(Class<? extends Throwable> exceptionType)
ExceptionMapping
s which this instance was configured with, it resolves the ErrorType
associated with the exception.
Resolution is done based on the different mappings taking into account most specific error types first and then the more
general ones.
If no error type can be find then Optional.empty()
will be returned.exceptionType
- the exception used to resolve the error type.public static ExceptionMapper.Builder builder()
ExceptionMapper
Copyright © 2018. All rights reserved.