Description of the bug
When trying to use the new feature ShouldRunAfterRemovingHiddenData in validators, the backend crashes if the expression evaluation fails. In the layout, you get an error message, but the component still renders with a default value for the expression. It might make sense to have similar behavior in the backend instead of throwing an unhandled exception.
Expected Behavior
Backend should handle expression evaluation errors gracefully and return a default value
Actual Behavior
The backend crashes with the following exception:
An unhandled exception has occurred while executing the request.
Altinn.App.Core.Internal.Expressions.ExpressionEvaluatorTypeErrorException: Expected number, got value "asd"
Steps To Reproduce
- Enable ShouldRunAfterRemovingHiddenData in a validator.
- Use an expression to hide a component:
["hidden": [ "lessThan", [ "component", "S11-PedagogiskVirksomhet-TotalDeltagelse-Input" ], 1 ],
- Provide invalid input (e.g., a string instead of a number).
Additional Information
No response
Description of the bug
When trying to use the new feature ShouldRunAfterRemovingHiddenData in validators, the backend crashes if the expression evaluation fails. In the layout, you get an error message, but the component still renders with a default value for the expression. It might make sense to have similar behavior in the backend instead of throwing an unhandled exception.
Expected Behavior
Backend should handle expression evaluation errors gracefully and return a default value
Actual Behavior
The backend crashes with the following exception:
Steps To Reproduce
["hidden": [ "lessThan", [ "component", "S11-PedagogiskVirksomhet-TotalDeltagelse-Input" ], 1 ],Additional Information
No response