Skip to content

Commit d42f7ed

Browse files
author
Ludo Galabru
committed
fix: better error
1 parent 011df85 commit d42f7ed

File tree

1 file changed

+13
-2
lines changed
  • components/clarinet-deployments/src

1 file changed

+13
-2
lines changed

components/clarinet-deployments/src/lib.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,19 @@ pub async fn generate_default_deployment(
472472
let mut contract_location = base_location.clone();
473473
contract_location
474474
.append_path(&contract_config.expect_contract_path_as_str())
475-
.unwrap();
476-
let source = contract_location.read_content_as_utf8().unwrap();
475+
.map_err(|_| {
476+
format!(
477+
"unable to build path for contract {}",
478+
contract_config.expect_contract_path_as_str()
479+
)
480+
})?;
481+
482+
let source = contract_location.read_content_as_utf8().map_err(|_| {
483+
format!(
484+
"unable to find contract at path {}",
485+
contract_config.expect_contract_path_as_str()
486+
)
487+
})?;
477488
sources.insert(contract_location.to_string(), source);
478489
}
479490
sources

0 commit comments

Comments
 (0)