Error messages like in Elm

What do you think about this for Elixir?

1 Like

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.

1 Like

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. ^.^

3 Likes

Hnn, the line can be shown this way?

What line?

You can see the new match errors reported on: https://elixir-lang.org/blog/2017/07/25/elixir-v1-5-0-released/
They are in the asciinema so make sure third-party javascript is enabled. It is quite nice. :slight_smile:

1 Like

@AstonJ The link in the initial post changed: https://reasonml.github.io/blog/2017/08/25/way-nicer-error-messages.html

1 Like

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!

1 Like

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…)?