-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Refactor errors, adding section for Message Function Errors #774
Conversation
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.
Good start.
Co-authored-by: Addison Phillips <[email protected]>
Co-authored-by: Addison Phillips <[email protected]>
fa42493
to
b76dc21
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.
One change proposed, otherwise looks good.
A **_<dfn>Message Function Error</dfn>_** is any error that occurs | ||
when calling a message function implementation |
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 like this use of the singular, and would suggest that the previous part of this document be updated accordingly (but for consistency, I think similar phrasing should be used for all sections in this PR).
Co-authored-by: Richard Gibson <[email protected]> Co-authored-by: Addison Phillips <[email protected]>
Co-authored-by: Addison Phillips <[email protected]>
As discussed yesterday and following @gibson042's suggestion in #774 (comment), I've now dropped the Selection Error and Formatting Error types. However, while doing so, I noticed that Selection Error was used in two places by our current spec:
In total, this means that two somewhat generic error types are replaced by two very specific ones. I also think we should consider adding something like Bad Formatter for placeholders that use a selection-only function annotation. As with Bad Selector, that error isn't really emitted by the function implementation, but by the MF2 implementation. But we can handle this as a separate next step. |
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.
Looks good! Mostly editorial suggestions.
Co-authored-by: Addison Phillips <[email protected]>
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
CC @mradbourne, who should be added to the repo.
As discussed yesterday, our error categories could be improved. This PR effects the categorisation we discussed, with "Message Function Error" introduced as the supertype of the errors that are coming from a custom function and "Invalid Expression" renamed to avoid its re-definition of what "valid" means in an MF2 context.
This and #767 should not be considered as blockers for each other. Instead, we'll need a fixup PR after both of these land adding the kebab-case error codes to
errors.md
and updating the ones used in the tests.