Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.2.5 (EE only)
-
Fix Version/s: 2.2.6 (EE only), 3.0.0
-
Component/s: Core: Exception Handling
-
Labels:
-
User impact:Low
-
Similar Issues:None
Description
When an exception is thrown inside a sync outbound endpoint (for example, in a transformer), the exception is handled by both the connector-exception-strategy and the service-exception-strategy (when in this case it should only be handled by the connector-exception-strategy since it happens in the transformer inside the outbound-endpoint). This works fine when the outbound-endpoint is async.
At the end of AbstractMessageDispatcher.send(MuleEvent event) there is this code:
catch (DispatchException e) { handleException(e); throw e; } catch (Exception e) { handleException(e); throw new DispatchException(event.getMessage(), event.getEndpoint(), e); }
This means that, whatever the handleException(e) method does, the exception is rethrown. If the dispatching is done on the same thread as the service (which is what happens when the outbound-endpoint is sync) then that exception will reach the service-exception-strategy, allowing it to handle it despite the fact that it might have already been handled but the connector-exception-strategy.
Changing this behavior could make things to break so I will have to analyze it deeper.
Issue Links
- relates to
-
MULE-4955
Refactor Exception Strategy invocation so we don't get exception strategies invoked twice
-
This issue was detected on EE-1968