-
-
Notifications
You must be signed in to change notification settings - Fork 36
Is it an error to pass a bad option to a function? #738
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
Comments
This error has nothing corresponding to it in the spec. The tests can be re-added once unicode-org#738 is resolved.
Why not? The description of that error is:
The value of options is an implementation-defined internal requirement... |
In the message, the value of the option isn't an expression. Though I guess you could argue that the expression as a whole, including the options, is invalid if one of the options is invalid. Still, since the test suite does use a separate error name for this case, I thought it was worth discussing. |
Totally worth the discussion. |
This could be either a Resolution Error or a Formatting Error:
|
We agreed in today's call that this issue will be blocked on an issue that @mihnita will open about error handling in general (the question of how to represent an error together with partial output / a fallback, given that this is hard to do idiomatically in ICU and perhaps elsewhere.) |
There is a |
I was looking at the following test case in https://github.com/unicode-org/message-format-wg/blob/main/test/test-functions.json :
This means that the message ".input {$foo :number minimumFractionDigits=foo} {{bar {$foo}}}" is supposed to trigger an error because the string "foo" can't be parsed as an integer.
However, there is no error in errors.md that corresponds to "bad-option" in the test description. Should there be one? It's not really covered by "invalid expression error" (or at least I don't think so); it's definitely not covered by "Operand Mismatch Error" since the description of that error only refers to the function's operand and not its options.
If this is really an error, I think there should be a separate "Option Mismatch Error" to go with "Operand Mismatch Error".
See #706 for the general issue to create a list of error names that can be used in spec tests. I thought this should be a separate issue since the registry spec doesn't say much about error handling for bad option values.
The text was updated successfully, but these errors were encountered: