diff --git a/bin/sozo/src/main.rs b/bin/sozo/src/main.rs index a0ac206689..eea47706c5 100644 --- a/bin/sozo/src/main.rs +++ b/bin/sozo/src/main.rs @@ -23,8 +23,7 @@ fn main() { let ui = Ui::new(args.ui_verbosity(), OutputFormat::Text); if let Err(err) = cli_main(args) { - ui.error(format!("{err}")); - err.chain().skip(1).for_each(|clause| eprintln!("reason: {:?}", clause)); + ui.anyhow(&err); exit(1); } } diff --git a/crates/dojo-world/src/migration/strategy.rs b/crates/dojo-world/src/migration/strategy.rs index 1e0b573ff7..8dddb832b0 100644 --- a/crates/dojo-world/src/migration/strategy.rs +++ b/crates/dojo-world/src/migration/strategy.rs @@ -69,8 +69,13 @@ pub fn prepare_for_migration( target_dir: &Utf8PathBuf, diff: WorldDiff, ) -> Result { - let entries = fs::read_dir(target_dir) - .map_err(|err| anyhow!("Failed reading source directory: {err}"))?; + let entries = fs::read_dir(target_dir).with_context(|| { + format!( + "Failed trying to read target directory ({target_dir})\nNOTE: build files are profile \ + specified so make sure to run build command with correct profile. For e.g. `sozo -P \ + my_profile build`" + ) + })?; let mut artifact_paths = HashMap::new(); for entry in entries.flatten() { diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index bf5e417a2f..e998b0fa36 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -75,9 +75,8 @@ where |e| { ui.error(e.to_string()); anyhow!( - "\n Use `sozo clean` to clean your project, or `sozo clean --manifests-abis` \ - to clean manifest and abi files only.\nThen, rebuild your project with `sozo \ - build`.", + "\n Use `sozo clean` to clean your project.\nThen, rebuild your project with \ + `sozo build`.", ) }, )?;