elm / error-message-catalog

A catalog of broken Elm programs / data to improve error messages
BSD 3-Clause "New" or "Revised" License
173 stars 17 forks source link

Package install with malformed package name produced unhelpful error message #282

Closed MartinSStewart closed 5 years ago

MartinSStewart commented 5 years ago

I ran elm install elm-geometry in PowerShell using Window 10 and got the following error message:

elm.exe: TODO show possible arg configurations
CallStack (from HasCallStack):
  error, called at ui/terminal/src\Terminal\Args\Error.hs:281:13 in main:Terminal.Args.Error

After a couple minutes I realized that I should have written elm install ianmackenzie/elm-geometry instead but I think it would be more helpful if the error message returned was something along the lines of Failed to install package. I expected the package name formatted as author/package-name.

evancz commented 5 years ago

Thanks for reporting this! On my development build, I am seeing the following error message:

$ elm install elm-geometry
I am having trouble with this argument:

    elm-geometry

It is supposed to be a <package> value, like one of these:

    elm/browser
    elm/core
    elm/parser
    elm/regex

So it looks like it got fixed as part of the infrastructure improvements there. The fixed version should become available once Elm 0.19.1 is released. Thank you for reporting this case!

evancz commented 5 years ago

I think it can be improved a bit more though. I'll give it a shot and get back to you!

evancz commented 5 years ago

Ah, it's a bit tricky. I know if I really start working on it there is a high chance the project will grow a bit larger than makes sense, so I think it makes sense to wait on it for now.