diff --git a/crates/aptos/src/move_tool/mod.rs b/crates/aptos/src/move_tool/mod.rs index ca18b93ea491d..47c5349cbf8ed 100644 --- a/crates/aptos/src/move_tool/mod.rs +++ b/crates/aptos/src/move_tool/mod.rs @@ -662,7 +662,8 @@ impl TryInto for &PublishPackage { self.move_options.named_addresses(), self.move_options.bytecode_version, ); - let package = BuiltPackage::build(package_path, options)?; + let package = BuiltPackage::build(package_path, options) + .map_err(|e| CliError::MoveCompilationError(format!("{:#}", e)))?; let compiled_units = package.extract_code(); let metadata_serialized = bcs::to_bytes(&package.extract_metadata()?).expect("PackageMetadata has BCS");