What is the difference between throw error and fail job?

Marek Šneberger: [go client]

Hello from Czech republic! :wave:

Is there some documentation / explanation in which case to use NewThrowErrorCommand() or NewFailJobCommand() and what is the difference?

Thanks :pray:

korthout: Hi @Marek Šneberger :wave:

They are both described in the gRPC reference: https://docs.camunda.io/docs/reference/grpc

• use FailJob when a technical error occurred
• use ThrowError when a business error occurred
In Bpmn a business error can be modeled in the process using error events: https://docs.camunda.io/docs/reference/bpmn-workflows/error-events/error-events
Technical errors should be left out of the process definition and handled exceptionally (an incident is raised, stopping the execution of the process, after the problem has been resolved, the incident can be resolved)

Note: This post was generated by Slack Archivist from a conversation in the Zeebe Slack, a source of valuable discussions on Zeebe (get an invite). Someone in the Slack thought this was worth sharing!

If this post answered a question for you, hit the Like button - we use that to assess which posts to put into docs.


Marek Šneberger: Thanks for reply :rocket: Now i understand the difference :slightly_smiling_face:

korthout: Happy to help :slightly_smiling_face: