-
Notifications
You must be signed in to change notification settings - Fork 55
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
Error constructor syntax is vulnerable to typos #393
Comments
This is related to #268. |
The old syntax #67 didn't have this problem, because it uses the record literal syntax.
|
@hasithaa Maybe I'm missing something somewhere, but I can't see how old syntax solves this issue. In my view, the root cause for the typo is |
#268 fixed the problem for mapping constructors. |
There will be a similar problem with functional constructors for mapping values as in #2. |
Here's one possible approach.
If you want to specify a cause but not a message, you can specify This doesn't address how to generate a message if the user doesn't explicitly specify one. There's lots of potential complexity there: i18n, formatting the message to include the fields from the detail record. Another point is that this is tied more to the distinct type than the detail record. |
This is solved by the revised error design in #509. |
This will be handled now in #550. |
I made a typo, I typed massage, instead of the message.
error("SERVICE ERROR", massage = "internal error occurred", cause = result);
One solution is to use
string-literal
(similar to mapping constructor) for non-field names defined in detail's record type descriptor. But it will be an incompatible change.The text was updated successfully, but these errors were encountered: