From 3e5f7a795f9fb12ac29d49e8cc93fc3aa1be6680 Mon Sep 17 00:00:00 2001 From: James Prestwich <10149425+prestwich@users.noreply.github.com> Date: Mon, 22 Feb 2021 10:35:40 -0800 Subject: [PATCH] feature: report path on failed abigen load (#205) --- ethers-contract/ethers-contract-abigen/src/source.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ethers-contract/ethers-contract-abigen/src/source.rs b/ethers-contract/ethers-contract-abigen/src/source.rs index 960a189c..0728a4dc 100644 --- a/ethers-contract/ethers-contract-abigen/src/source.rs +++ b/ethers-contract/ethers-contract-abigen/src/source.rs @@ -171,7 +171,10 @@ fn get_local_contract(path: &Path) -> Result { Cow::Borrowed(path) }; - let json = fs::read_to_string(path).context("failed to read artifact JSON file")?; + let json = fs::read_to_string(&path).context(format!( + "failed to read artifact JSON file with path {}", + &path.display() + ))?; Ok(json) }