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
Improve active pattern errors #1389
Comments
Interesting, I usually just check the warnings that tell me about non-exhaustive pattern matching but it should definitely be possible to have a more informative message for pattern matching errors. We just need to find a way to identify this kind of exceptions. |
I do that in general but when you have several non implement case it's not helping :) Also, when adding a subcomponent this can help identify which parent didn't update it correctly etc. Is it fable writting: |
It's from the F# compiler AST. I guess it's using a particular kind of exception (which we may use to identify it) but Fable is translating it as a general exception at the moment. |
Fixed by #1611, thanks @Zaid-Ajaj! |
Description
Considering the next code:
We generate this code:
Proposition
I would like to add a custom
Error
type to Fable:MatchError
(or something like that) and generate something like:Why ?
The idea behind this proposition is to make Elmish errors understandable.
Today we have something like:
Tomorrow we could have:
Also, if this is a nested DU we get direct access to the whole tree:
This can be really useful in Elmish application where every message is a nested DU
The text was updated successfully, but these errors were encountered: