Skip to content

Commit

Permalink
don't panic on compiler errors
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege committed Jan 5, 2024
1 parent 03c48a5 commit 1bf6055
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ use foundry_evm::{
};
use once_cell::sync::Lazy;
use std::{fmt::Debug, fs, path::PathBuf};
use ethers::solc::SolcConfig;

static EVM_OPTS: Lazy<EvmOpts> = Lazy::new(|| EvmOpts {
env: Env {
Expand All @@ -58,7 +59,6 @@ static EVM_OPTS: Lazy<EvmOpts> = Lazy::new(|| EvmOpts {

/// Builds a non-tracing runner
fn runner_with_root(root: PathBuf) -> MultiContractRunner {
dbg!(&root);
let mut paths = ProjectPathsConfig::builder().root(root.clone()).build().unwrap();

// parse remappings from remappings.txt.
Expand Down Expand Up @@ -87,8 +87,7 @@ fn runner_with_root(root: PathBuf) -> MultiContractRunner {

let compiled = project.compile().unwrap();
if compiled.has_compiler_errors() {
eprintln!("{compiled}");
panic!("Compiled with errors");
eprintln!("Compiler errors: {compiled}");
}

let mut config = Config::with_root(root.clone());
Expand Down

0 comments on commit 1bf6055

Please sign in to comment.