When executing an AIF-service with the COM and .Net Business Connector the client will not be notified about exceptions during the execution. The reason for this is, that AIF-services are always executed within a transaction (ttslevel = 1) even when no ttsBegin has been executed. And as described on the X++ blog, exceptions are not caught within the transaction (sample is taken from the X++ blog):
3: MyTableType t;
4: ttsBegin; // Start a transaction
7: throw error(“Something bad happened”);
11: // Innermost catch block
13: update_recordset t … // Must run within a transaction
14: ttsCommit; // Commit the transaction
18: Info (“In outermost exception handler”);
The exception thrown in line 7 would be caught in line 16.
If you need to handle the exceptions on the client-side, you can create a workaround by calling a ttsAbort before executing the AIF-service code. The best way to implement this workaround is to create a new AIF-service that executes the ttsAbort before calling the original AIF-service code. In that case the original AIF-service can stay “as is”.