Configure global exception handling with spring boot?

Hi there,

we use Camunda BPM as an embedded Engine with the spring boot starter.
In a couple of listeners and delegation code we throw exceptions when certain technical errors occur.
However, those exceptions always get caught by Camunda at some point and are then wrapped in an “EngineException”. Something along the lines of:

ENGINE-03051 There was an exception while invoking the TaskListener. Message: ‘Exception while invoking TaskListener: Error while evaluating Expression…

Since this is ultimately the result of a REST-call, this exception becomes part of the response, which is a problem both in terms of user experience and security.

Now here’s my question: is it possible to configure the Engine in a way that our own Exceptions are no longer wrapped in Engine-Exceptions or do we have no other choice than to catch those Engine-Exceptions ourselfs if we want to avoid them becoming part of a REST-response?

Thanks in advance,
BenF