as we currently implement a connector we had a look into already existing ones and frequently observed the opportunity for specifing an error expression as part of the panel of properties (see attached).
However, when looking through the codebase in Git of the connectors present in marketplace (take the AWS Lambda Connector as an example) we cannot see any code that makes sense of this error expression.
Is this something the Connector-SDK takes care of behind the scenes without requiring the developer to implement logic for evaluting this expression?
Furthermore, could you give a concrete example of what such an error expression could look a like using the example of the AWS lambda function? Is there a typical feel expression that frequently occurs for the purpose of defining an error handling at task level?
Hi @astro - the Connector SDK comes with some exception handling that triggers BPMN errors:
If the Connector handles exceptional cases, it can use any exception to express technical errors. If a technical error should be associated with a specific error code, the Connector can throw a
ConnectorException and define a
code as shown in (3). We recommend documenting the list of error codes as part of the Connector’s API. Users can build on those codes by creating BPMN errors in their Connector configurations. (source)
In the AWS Lambda Connector, you can see that here (along with other exceptions generated during runtime). You can find more information on the error expression, and how that works with Zeebe, on this page.
Thanks @nathan.loding! Thats a good explanation when to use the error expression for exceptions and errors.
Error expressions allow you also to raise an error (bpmn or technical error with a retry) even for successful executions of a Connector.
@astro Imagine your Lambda executed successfully but based on the response you want to raise an error because it contained a state or any data in the response that you did not expect. The error expression allows users to create an incident (or an error with a retry) based on an arbitrary FEEL expression.
thanks to you both, @nathan.loding and @sbuettner!