Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize the error handling #260

Closed
saig0 opened this issue Apr 9, 2021 · 1 comment · Fixed by #687
Closed

Customize the error handling #260

saig0 opened this issue Apr 9, 2021 · 1 comment · Fixed by #687
Assignees

Comments

@saig0
Copy link
Member

saig0 commented Apr 9, 2021

Is your feature request related to a problem? Please describe.
FEEL doesn't have strict error handling. An expression may evaluate to null (and continue). For example, if the types don't match or a function is called with the wrong arguments.

For example:

"order-" + 123
// WARN  org.camunda.feel.FeelEngine - Suppressed failure: expected String but found 'ValNumber(123)'
// should be "order-" + string(123)

date("01-01-2021")
// null - wrong format
// should be date("2021-01-01")

In some cases, you want to have different behavior. For example, collect and report all (suppressed) failures. This may help to identify failures and to correct the expression.

Describe the solution you'd like
Have the option to customize the error handling. For example, using an SPI like for the value mapper and the function provider.

A solution could be to give control of the error handling to the caller of the API.

If the engine can't evaluate a part of the expression successfully then it collects the failure and continues the evaluation with null. It may return null as the result of the evaluation and exposes the collected failures (i.e. failure message + failure type).

Based on the collected failures, the caller can decide if the evaluation was successful or not.

Related issues

Kind of related to #259

@saig0
Copy link
Member Author

saig0 commented Dec 22, 2022

We discussed this topic recently here. We came up with some new ideas. I updated the solution in the issue description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants