From d49a833426d7364f85804cc74db0b00006c70ecf Mon Sep 17 00:00:00 2001 From: "Daniel Porteous (dport)" Date: Wed, 7 Jun 2023 17:32:30 +0100 Subject: [PATCH] [CLI] Improve error message when compilation fails in aptos move publish (#8556) --- crates/aptos/src/move_tool/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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");