gleam-lang/gleam

Improve error message for invalid dependency

Open

#4,925 建立於 2025年9月3日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)Rust (21,417 star) (960 fork)batch import
help wanted

描述

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!

貢獻者指南