chshersh / tool-sync

🧰 Download pre-built binaries of all your favourite tools with a single command
https://crates.io/crates/tool-sync
Mozilla Public License 2.0
72 stars 17 forks source link

Consider using `human-panic` for better error reporting #53

Open popzxc opened 2 years ago

popzxc commented 2 years ago

Heya! Looking at this file it seems that you've imlpemented a small toolset for graceful exits upon meeting an irrecoverable error.

However, there exists a crate named human-panic which serves the same functionality, but handles everything automatically and provides more info for debug. As a bonus, it'll also catch any other panic if it'll ever occur.

chshersh commented 2 years ago

Thanks for the suggestion! I haven't heard about the human-panic package, it looks cool 👍🏻 I guess, the only argument for not using it is to have fewer dependencies 🤔

Also, in my file I'm using process::exit(1) instead of panic!("..."). Will there be any difference?

popzxc commented 2 years ago

Well, Rust uses error code 101 for panics. I don't think there should be any other differences related to the process termination.