-
Notifications
You must be signed in to change notification settings - Fork 71
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(diagnostics): improve fallibility error notes #523
Conversation
@@ -9,10 +9,12 @@ | |||
# │ │ │ | |||
# │ │ this expression is fallible | |||
# │ │ update the expression to be infallible | |||
# │ │ note if an argument type is invalid it can render a function fallible |
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 think it would be great if we could go even further and say, for cases where the function is fallible due to the argument type not being known to be valid, that:
this expression is fallible because argument `.result[0].an` is of type `any` and this function expects a `string`. It will fail at runtime if `.result[0].an` is not a `string`
The currently added message is definitely an improvement, but I think users will remain largely confused by this behavior of VRL.
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.
@jszwedko: Agreed, good point.
However, I don't have time to do it before this upcoming release. Two options:
- Get this improvement in and follow up with another PR (to be included in the next release)
- Leave this PR open
What do you prefer?
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'm fine with merging this since it is an improvement and then following up. I just want to make sure we don't close out #23 until we do that.
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.
Sounds good. Added a reminder here.
Merging this PR won't close the ticket, so if you give this a ✅ I will include it in the VRL release.
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.
It was more involved than expected but implemented this here: #553
part of #23