Custom Exceptions from Scripts

When using Scripts as Listeners or for OutputMappings, one can throw custom Exceptions like this:
throw new org.camunda.bpm.spring.boot.example.webapp.exceptions.InputValidationException("CRASHED", 21000);

Lets say we have a message catch event (user task/ external task etc. should be the same) and in the output mapping the error above is thrown. When you then correlate a message through the REST API:

POST localhost:8080/engine-rest/message Content-Type: application/json { "processInstanceId": "{{instanceId}}", "messageName": "testMessage", "processVariables": { "variable": { "value": "TEST", "type": "String" } } }

An error is returned, but it is a ScriptEvaluationException instead of the expected InputValidationException:

{ "type": "ScriptEvaluationException", "message": "Unable to evaluate script while executing activity 'Event_0q7iy24' in the process definition with id 'messages:2:9b71c786-197f-11ee-bf98-b07d6486af2d':org.camunda.bpm.spring.boot.example.webapp.exceptions.InputValidationException: CRASHED", "code": 0 }

My question is: Is there a way to get this kind of a response:

{ "type": "InputValidationException", "message": "CRASHED", "code": 21000 }