Multi-instance parallel subprocess and BPMN Errors

I’m using a Parallel Multi-instance subprocess, where the transaction boundaries are set up so that the contents are run in non-exclusive tasks, but the finalization is exclusive to avoid OptimisticLockingExceptions.

This works quite well unless something in the process raises a BPMN error. The main process has an event subprocess for catching and handling BPMN errors, so every running instance of the subprocess should be terminated. However, the BPMN error is thrown inside a non-exclusive job, so said termination does not happen safely, leading to OptimisticLockingExceptions.

Is there any way to shift the error handling into an exclusive job?

I tried using a very simple Event Subprocess inside the subprocess, which would simply catch any errors and then rethrow them inside an exclusive job, but this ran into the problem that I’m unable to use variables in the Code and Message fields of the throw event.