Greetings,
I am using the rest connector to make a query, if some fields are poorly filled out the request may result in an error, the service which makes the request with the rest connector returns a message explaining the reason for the error and I intend to show this error on the form , is there any way to capture the error message?
ATT: CAMUNDA 8
Hi @Domingos_Dias - the error
object has a message
property (and an optional code
property.
Thank you @nathan.loding, but, how can I access this message property and store it in a variable for example?
@Domingos_Dias - in the error expression like any other variable. For instance:
={
testErrorCode: error.code,
testErrorMessage: error.message,
}
If you have a specific result you are looking for I can try to help craft the FEEL expression.
After a lot of research I managed to solve this problem.
Almost all error handling in camunda is exemplified with task service, and it was difficult without practical examples to understand the behavior in a REST connector. In short, what I did was the following:
1-I mapped the most common errors I may have;
2-For each specific type of error, assign the code and message to a variable following the cue from @nathan.loding ;
3-I assigned these variables to other output variables in the ERROR BOUNDARY EVENT;
Imagem de auxílio em anexo:
I hope this answer helps anyone having the same problem in the future.
@Domingos_Dias - in your screenshots you are using the Output Mapping, not the Error Expression. With the out of the box connectors, those expressions are resolved in the Connector Runtime, not within Zeebe. In other words, the error
object only exists in the Error Expression. Any data returned from the Error Expression can be used later in the process, for instance as part of the output mappings. (This is also true of the response data; the FEEL expression is resolved in the Connector Runtime, so it only has access to data within the Runtime and not the entire process.)
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.