I think the error code is set correctly.
The point is that the Error Message is being caught by the websocket connection at any point (that means before the User Task is complete).
But, yes, your idea to have an execution listener may work.
But should I specify the Execution Listener at “start” or “end”?
Also, how can I call that Execution Listener from another Java class that handles the websocket messages?
Thanks!