Need help on error handling

My structure is like this

i have defined all the worker implementation in a basicworker file
and created and subscribed topic to each specific service tasks
but now i want to throw a error for each service tasks and pass Error code and then catch the error code and implement logic on the caught event
but i looked online and it says to use BPMNerror Class but not sure if there is any reference for throwing BPMN error from the process or where and what package need to imported

Vish

Hi @vishucamunda,

at the end your client has to call https://docs.camunda.org/manual/7.11/reference/rest/external-task/post-bpmn-error/ to signal the error to the process engine.

If you use the External task client for Java, you have to call this method in your handler: https://github.com/camunda/camunda-external-task-client-java/blob/master/client/src/main/java/org/camunda/bpm/client/task/ExternalTaskService.java#L129-L142.

The process will now continue with the outgoing sequence flow of the attached Error event.

Hope this helps, Ingo