Triggering an Incident outside of a listener call stack

We have a couple of listeners embedded in our process definitions. When during the execution of one of those listeners an exception occurs, the involved process generates an incident context, with which our default incident handler is called, and the process is terminated.

We are trying to trigger the same operations when the process is within a task execution, where we have no listener in the stack to trigger the execution. I have tried reading the data for the IncidentContext from the database, extracting the Incident handler from the process engine configuration object and then calling our listener with it, but doing it this way leads to exception deep in the Camunda process engine.

I was hoping there is an API for this scenario, but I haven’t yet been able to find it.

Can anyone help?