Skip to content

Commit

Permalink
chore: better error for missing contract bytecode
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Dec 8, 2023
1 parent 8033139 commit 3f66d07
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/common/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,12 @@ pub async fn compile_from_source(
.map(|(aid, art)| {
(aid, art.source_file().expect("no source file").id, art.into_contract_bytecode())
})
.expect("there should be a contract with bytecode");
.ok_or_else(|| {
eyre::eyre!(
"Unable to find bytecode in compiled output for contract: {}",
metadata.contract_name
)
})?;
let bytecode = compact_to_contract(contract)?;

root.close()?;
Expand Down

0 comments on commit 3f66d07

Please sign in to comment.