Generic error handling block

If there a way to catch any type of errors thrown from subprocess, whose script task or service task can throw java RuntimeException or any other type of Exception?
I see ErrorBoundary only catches BpmnError. Is there a better way to handle java Exception in generic way for BPMN.
Currently in case of java Exception, process is getting terminated abruptly without allowing to do any post processing.

Thanks.

1 Like

Hi @pankaj,

In order to catch non BpmnError exceptions via error events, you can set the errorCode attribute to the exception’s full-qualified classname (or that of a superclass). See https://docs.camunda.org/manual/7.7/reference/bpmn20/events/error-events/#defining-an-error for details.

Cheers,
Thorben

2 Likes