Error messages like in Elm

error-messages

#1

What do you think about this for Elixir?


#2

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.


#3

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


#4

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


#5

Hnn, the line can be shown this way?


#6

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:


#7

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


#8

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!


#9

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