-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: Make failure messages more readable #717
Conversation
5ae2a19
to
4f7794d
Compare
@nicpuppa I improved the failure messages as a follow-up from our last PR. Please have a look. 🍪 |
Copy the existing string representation logic of the `string()` function into the value types.
Replace the custom string representation logic of the `string()` function with the `toString()` method of the types.
Uniform the failure messages. Add missing failure types.
The functions `andThen()` and `compose()` are auto-generated by Scala. We can ignore changes on these functions.
4f7794d
to
269a60f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, very big improvement 💪
src/main/scala/org/camunda/feel/impl/builtin/ConversionBuiltinFunctions.scala
Show resolved
Hide resolved
) | ||
} | ||
|
||
it should "report a suppressed failure if an addition has incompatible values" in { | ||
evaluateExpression("2 + true") should reportFailure( | ||
failureType = EvaluationFailureType.INVALID_TYPE, | ||
failureMessage = "Expected Number but found 'ValBoolean(true)'" | ||
failureMessage = "Expected number but found 'true'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ How this is possible ? 🪄
Number -> number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I aligned the failure messages and changed the type names to start with a lowercase. See here. 🚀
Description
string()
function into the value types.Related issues
closes #713