diff --git a/crates/sui/src/sui_commands.rs b/crates/sui/src/sui_commands.rs index 70aacecad733a..8ab6c33e53914 100644 --- a/crates/sui/src/sui_commands.rs +++ b/crates/sui/src/sui_commands.rs @@ -631,7 +631,7 @@ async fn start( swarm_builder = swarm_builder.with_epoch_duration_ms(epoch_duration_ms); } else { if config.is_none() && !sui_config_dir()?.join(SUI_NETWORK_CONFIG).exists() { - genesis(None, None, None, false, epoch_duration_ms, None, false).await?; + genesis(None, None, None, false, epoch_duration_ms, None, false).await.map_err(|_| anyhow!("Cannot run genesis with non-empty Sui config directory: {}.\n\nIf you are trying to run a local network without persisting the data (so a new genesis that is randomly generated and will not be saved once the network is shut down), use --force-regenesis flag.\nIf you are trying to persist the network data and start from a new genesis, use sui genesis --help to see how to generate a new genesis.", sui_config_dir().unwrap().display()))?; } // Load the config of the Sui authority.