Why getLastError must be the first service under catch block?

Hi,

In the try/catch block sequence, we must have getLastError as the first service under catch block. Else it won’t show you th error details that occured.

But what is the reason behind this? Why doesn’t it show the lastError details if its not the first service under catch block?

Thanks.

Service getLastError will retrieve error information from InvokeState, and some of flow steps like MAP, INVOKE will overwrite error information after execution, that’s the reason you have to place it as the first service.

1 Like

Yes I second with Wang and that is the default way of handling the catch sequence with getLastError as the first step and map/capture steps follows to it to signal the error failure!

HTH,
RMG

1 Like

Thanks for your reply.

Small doubt, what exactly does InvokeState mean?

Hi,

InvokeState contains the status of the execution (invocation) of the previous step.

See IntegrationServer Java API Reference for details (for the case that this is not flagged “internal use only” like the services in WmRoot).

Regards,
Holger