Question
· May 9, 2024

Business Service error handling - exception not visible in Log

We have a custom business service that is triggered by a scheduled task. The service queries a table, iterates over the result set and sends a message on to a business process for each result. Happy path functionality is all fine.

However, when there is an error detected in the business service code, neither throwing an exception nor returning an error %Status behaves as we'd expect.

Our error handling scheme, which is working for the other business processes and operations, is to throw an exception on error. Messages are suspended, allowed to error, or the component disabled depending on the nature of the error detected, and alerts successfully sent on to Ens.Alert. Again, apart from this business service, all is working as expected.

Here's the current start of the business service OnProcessInput method:

Even deliberately forcing an exception (as screenshot above), or explicitly returning an error status (as commented out in screenshot) does not show an error in the Log - see second screenshot below - you can see the trace message, but no sign of the exception - and nothing goes to Ens.Alert. But processing does stop at this point - no code further on in the method is executed.

Does exception handling work differently for business services compared to business processes? Or is it something to do with the scheduled task triggering mechanism? We are pretty confused about what is going on! Any insights welcome!

Product version: Ensemble 2018.1
$ZV: Cache for Windows (x86-64) 2018.1 (Build 184U) Wed Sep 19 2018 09:09:22 EDT
Discussion (1)1
Log in or sign up to continue

Not sure it counts as an answer, but what we did to step round this issue was to move the bulk of the functionality - where the error handling was required - into a new business process, leaving only the most basic "pass the trigger message along" functionality in the business service. Added an extra component to the production, but we can now see errors in the log when they occur, and they are passed appropriately to Ens.Alert.