Reputation: 1
This has to be a common scenario yet I only came across the following link so far addressing it - I have a bunch of Data Mapper elements doing Pojo to Pojo transformation and need a way to reliably capture the exceptions - right now an exception happens but there is no indication of which mapper the exception occurred in.
Can someone please point to a link which describes how to capture these errors in the mapper Thanks
Upvotes: 0
Views: 347
Reputation: 11606
The easiest way is probably to put each data mapper transformer in a private flow with their own local exception strategies:
<flow name="main">
<flow-ref name="transform1" />
<flow-ref name="transform2" />
</flow>
<flow name="transform1">
<data-mapper:transform config-ref="grf1" />
<catch-exception-strategy>
<!-- do something -->
</catch-exception-strategy>
</flow>
<flow name="transform2">
<data-mapper:transform config-ref="grf2" />
<catch-exception-strategy>
<!-- do something -->
</catch-exception-strategy>
</flow>
Upvotes: 0