Search in sources :

Example 1 with EnrichedNotificationInfo

use of org.mule.runtime.api.notification.EnrichedNotificationInfo in project mule by mulesoft.

the class MessagingExceptionResolver method enrich.

private MessagingException enrich(MessagingException me, Component failing, CoreEvent event, MuleContext context) {
    EnrichedNotificationInfo notificationInfo = createInfo(event, me, null);
    context.getExceptionContextProviders().forEach(cp -> {
        cp.getContextInfo(notificationInfo, failing).forEach((k, v) -> me.getInfo().putIfAbsent(k, v));
    });
    return me;
}
Also used : EnrichedNotificationInfo(org.mule.runtime.api.notification.EnrichedNotificationInfo)

Example 2 with EnrichedNotificationInfo

use of org.mule.runtime.api.notification.EnrichedNotificationInfo in project mule by mulesoft.

the class SourceErrorException method toMessagingException.

public MessagingException toMessagingException(Collection<ExceptionContextProvider> exceptionContextProviders, MessageSource messageSource) {
    MessagingException messagingException = new MessagingException(CoreEvent.builder(getEvent()).error(ErrorBuilder.builder(getCause()).errorType(getErrorType()).build()).build(), getCause());
    EnrichedNotificationInfo notificationInfo = createInfo(messagingException.getEvent(), messagingException, null);
    exceptionContextProviders.forEach(cp -> {
        cp.getContextInfo(notificationInfo, messageSource).forEach((k, v) -> messagingException.getInfo().putIfAbsent(k, v));
    });
    return messagingException;
}
Also used : MessagingException(org.mule.runtime.core.internal.exception.MessagingException) EnrichedNotificationInfo(org.mule.runtime.api.notification.EnrichedNotificationInfo)

Aggregations

EnrichedNotificationInfo (org.mule.runtime.api.notification.EnrichedNotificationInfo)2 MessagingException (org.mule.runtime.core.internal.exception.MessagingException)1