Coverage Report - org.mule.processor.ExceptionHandlingMessageProcessor
 
Classes in this File Line Coverage Branch Coverage Complexity
ExceptionHandlingMessageProcessor
0%
0/9
0%
0/2
5
 
 1  
 /*
 2  
  * $Id: ExceptionHandlingMessageProcessor.java 20465 2010-12-05 18:14:15Z mike.schilling $
 3  
  * -------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.processor;
 12  
 
 13  
 import org.mule.api.MuleEvent;
 14  
 import org.mule.api.MuleException;
 15  
 import org.mule.config.ExceptionHelper;
 16  
 import org.mule.message.DefaultExceptionPayload;
 17  
 import org.mule.transport.NullPayload;
 18  
 
 19  0
 public class ExceptionHandlingMessageProcessor extends AbstractInterceptingMessageProcessor
 20  
 {
 21  
     public MuleEvent process(MuleEvent event) throws MuleException
 22  
     {
 23  
         try
 24  
         {
 25  0
             return processNext(event);
 26  
         }
 27  0
         catch (Exception e)
 28  
         {
 29  0
             e = (Exception) ExceptionHelper.sanitizeIfNeeded(e);
 30  0
             if (e instanceof InternalProcessingException)
 31  
             {
 32  0
                 event.getMessage().setPayload(NullPayload.getInstance());
 33  0
                 event.getMessage().setExceptionPayload(new DefaultExceptionPayload(e));
 34  0
                 return event;
 35  
             }
 36  
             else
 37  
             {
 38  0
                 return event.getFlowConstruct().getExceptionListener().handleException(e, event);
 39  
             }
 40  
         }
 41  
     }
 42  
 }