gleam-lang/gleam

Improve error message for invalid dependency

Open

#4925 aperta il 3 set 2025

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)Rust (960 fork)batch import
help wanted

Metriche repository

Star
 (21.417 star)
Metriche merge PR
 (Merge medio 10g 19h) (69 PR mergiate in 30 g)

Descrizione

Right now if I try and use a git dependency and mess up one of the fields the error I get looks like this:

error: File IO failure

An error occurred while trying to parse this file:

    /Users/giacomocavalieri/Documents/progetti/giacomocavalieri.me/gleam.toml

The error message from the file IO library was:

    TOML parse error at line 6, column 7
  |
6 | jot = { a = "58499d73c0a980f4d6cfb04b7cbfab9198238b76" }
  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
data did not match any variant of untagged enum Requirement

That big underline is not all that useful and is talking about compiler internals, I think it would be nice if it provided a better error message here. Not sure what it would look like!

Guida contributor