Skip to content

Commit

Permalink
improve the error message for missing zk compiler output (#82)
Browse files Browse the repository at this point in the history
Co-authored-by: Tamer Tas <tmrtx@noreply>
  • Loading branch information
tmrtx and Tamer Tas authored May 16, 2023
1 parent a17053d commit c955868
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cli/src/cmd/forge/zk_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,10 @@ impl ZkCreateArgs {
///
/// A `serde_json::Value` that represents the contract output.
fn get_contract_output(output_path: PathBuf) -> Value {
let data = fs::read_to_string(output_path).expect("Unable to read file");
let res: serde_json::Value = serde_json::from_str(&data).expect("Unable to parse");
let data = fs::read_to_string(&output_path)
.expect(&format!("Unable to read contract output file at {}", output_path.display()));
let res: serde_json::Value = serde_json::from_str(&data)
.expect(&format!("Unable to read contract output file at {}", output_path.display()));
res["contracts"].clone()
}

Expand Down

0 comments on commit c955868

Please sign in to comment.