cargo-edit icon indicating copy to clipboard operation
cargo-edit copied to clipboard

Bad non-descriptive error message in src/error.rs in invalid_cargo_config function

Open Rx1513 opened this issue 8 months ago • 2 comments

I'm currently packaging cargo upgrade and bumped into "Invalid cargo config" error during running tests. And it created like ton of questions: What is this even supposed to mean? Like what one of multiple cargo configs is invalid? What is considered "invalid"? Is it broken symbols? Is it broken paths? What do I do to fix this error?

So, you got the point, this error does not provide the user with almost any useful information to correct the error. It would be better if this error provided the user with information such as "what config", "why is it invalid" and "how to fix it".

Actually, the problem was that I was using .cargo/config.toml for vendoring, which doesn't really match the common build configuration.

Rx1513 avatar May 07 '25 15:05 Rx1513

#834 improved the errors somewhat but we're unlikely to improve it much further and instead the focus should be towards figuring out how this should exist in Cargo.

epage avatar May 07 '25 15:05 epage

Thank you!

#834 improved the errors somewhat but we're unlikely to improve it much further and instead the focus should be towards figuring out how this should exist in Cargo.

I can try to improve this on upcoming weekends.

Rx1513 avatar May 07 '25 16:05 Rx1513