Generic error event handler

I’m wondering if the following is possible:

I would like to be able to define one service task that can handle defined boundary event errors and process them based on their error code.

But from using the Zeebe C# Client and reading the docs I can’t see:

  • where the error code would be available within the Generic Error Handler service task?
    or
  • how the process variables could be updated to include the error code before it is thrown in Step 1 or Step 2?
    or
  • if there’s just a better approach within zeebe?

Thanks

Hi @pmccolgan,

currently, it is not possible to store the error code of the caught error event in a workflow instance variable. Also, it is not possible to catch any error event unrelated to its error code using one error catch event.

I see that this could be useful. Feel free to open a new feature request.

However, you can model this also in the following way:

  • multiple error event subprocesses / error boundary events - one for each error code
  • one generic error handler task
  • the task has a custom header errorCode that is set to the error code of the error catch event

Does this help you?

Best regards,
Philipp

1 Like

Thank you @philipp.ossler what you proposed there works perfectly for me, I was unaware of the headers I could apply and hadn’t considered re-using the same service task in multiple sub processes but that’s exactly how I’ve done it and it works.