alire-project / alire

Command-line tool from the Alire project and supporting library
GNU General Public License v3.0
288 stars 49 forks source link

unclear error message #1087

Open RREE opened 2 years ago

RREE commented 2 years ago

Having a typo in a alire.toml the corresponding error message does not point to the actual problem.

My alire.toml had the following lines:

[[depends-on]]
cortex_m = "~0.3"
hal = "#"
usb_embedded = "~0.3"
gnat_arm_elf = "^12"

The problem is in the line about hal. It is a typo and was supposed to read hal = "*". The error message, however, did not make it clear (to me, at least) where the problem is.

❯ alr update
error: Cannot continue with invalid session:
error:    Loading release from manifest: alire.toml:
error:    Failed to load alire.toml:
error:    Unexpected symbol: # (at char 1)

I think it'd be helpful if the corresponding crate was mentioned, too. Perhaps sth like "[[depends-on]], crate "hal" has incorrect version"

mosteo commented 2 years ago

Thanks for the suggestion, Rolf. Indeed, we can enhance the contextual information in this case.