Skip to content

Commit

Permalink
fix: better error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludo Galabru committed Oct 11, 2022
1 parent 011df85 commit d42f7ed
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions components/clarinet-deployments/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,19 @@ pub async fn generate_default_deployment(
let mut contract_location = base_location.clone();
contract_location
.append_path(&contract_config.expect_contract_path_as_str())
.unwrap();
let source = contract_location.read_content_as_utf8().unwrap();
.map_err(|_| {
format!(
"unable to build path for contract {}",
contract_config.expect_contract_path_as_str()
)
})?;

let source = contract_location.read_content_as_utf8().map_err(|_| {
format!(
"unable to find contract at path {}",
contract_config.expect_contract_path_as_str()
)
})?;
sources.insert(contract_location.to_string(), source);
}
sources
Expand Down

0 comments on commit d42f7ed

Please sign in to comment.