foundry-rs / compilers

Utilities for working with native solc and compiling projects.
Apache License 2.0
58 stars 36 forks source link

Improve error message when can't find `solc` #76

Open AbhinavMir opened 4 months ago

AbhinavMir commented 4 months ago

I ran the example in the README as is, and didn't realize I did not have solc installed. It gave me the following error:

Running `target/debug/compiler-test`
thread 'main' panicked at src/main.rs:9:36:
called `Result::unwrap()` on an `Err` value: Io(SolcIoError { io: Os { code: 2, kind: NotFound, message: "No such file or directory" }, path: "solc" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This seems pretty opaque, I think a simple error message in the vein of "solc not installed" would be more communicative.

I can fix this, but I couldn't figure out where the error is being thrown.

Cheers!