Error messages like in Elm



What do you think about this for Elixir?


Nice! We have some steps in that direction with Exception.blame in v1.5. Thou I would rephrase the question to “That errors output in elixir do you think should be better handled?” Because it’s not a general approach, but context/error specific.


So far as I see is it general and some might think, the current solution is more suitable.


Statically typed languages are able to give error messages like that because the compiler knows the types and can infer a lot of information based on that, Elixir’s would not be capable of near the same level.

However, Elixir has some really nice messages, like the new showing which cases did and did not match so you know why things fail a match is unique. ^.^


Hnn, the line can be shown this way?


What line?

You can see the new match errors reported on:
They are in the asciinema so make sure third-party javascript is enabled. It is quite nice. :slight_smile:


@AstonJ The link in the initial post changed:


Can’t we really have messages like that? Just showing the line in the format its presented, the position of the error and an verbose explanation for possible causes would help a lot!


Doesn’t elixir already do that for most errors if the information is available (I.E. full compiled module, recent OTP that Elixir is compiled with, etc…)?