Search in sources :

Example 1 with ExceptionNotification

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

the class AbstractExceptionListener method fireNotification.

protected void fireNotification(Exception ex, CoreEvent event) {
    if (enableNotifications) {
        if (ex.getCause() != null && getCause(ex) instanceof SecurityException) {
            fireNotification(new SecurityNotification((SecurityException) getCause(ex), SECURITY_AUTHENTICATION_FAILED));
        } else {
            Component component = null;
            if (ex instanceof MessagingException) {
                component = ((MessagingException) ex).getFailingComponent();
            }
            fireNotification(new ExceptionNotification(createInfo(event, ex, component), getLocation()));
        }
    }
}
Also used : MessagingException(org.mule.runtime.core.internal.exception.MessagingException) ExceptionNotification(org.mule.runtime.api.notification.ExceptionNotification) SecurityException(org.mule.runtime.api.security.SecurityException) Component(org.mule.runtime.api.component.Component) SecurityNotification(org.mule.runtime.api.notification.SecurityNotification)

Aggregations

Component (org.mule.runtime.api.component.Component)1 ExceptionNotification (org.mule.runtime.api.notification.ExceptionNotification)1 SecurityNotification (org.mule.runtime.api.notification.SecurityNotification)1 SecurityException (org.mule.runtime.api.security.SecurityException)1 MessagingException (org.mule.runtime.core.internal.exception.MessagingException)1