From 354e6ca48c111edd7e7b871c2d15ac700f4f77ad Mon Sep 17 00:00:00 2001 From: Elizabeth Engelman <4752801+elizabethengelman@users.noreply.github.com> Date: Thu, 15 Aug 2024 11:26:07 -0400 Subject: [PATCH] Logging when there is no internet connection --- .../src/commands/network/container/start.rs | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/cmd/soroban-cli/src/commands/network/container/start.rs b/cmd/soroban-cli/src/commands/network/container/start.rs index 05f1637d84..b83ca48f7c 100644 --- a/cmd/soroban-cli/src/commands/network/container/start.rs +++ b/cmd/soroban-cli/src/commands/network/container/start.rs @@ -91,13 +91,22 @@ impl Runner { None, ); - while let Ok(Some(output)) = stream.try_next().await { - if let Some(status) = output.status { - if status.contains("Pulling from") - || status.contains("Digest") - || status.contains("Status") - { - self.print.infoln(format!("{}", status)); + while let Some(result) = stream.try_next().await.transpose() { + match result { + Ok(item) => { + if let Some(status) = item.status { + if status.contains("Pulling from") + || status.contains("Digest") + || status.contains("Status") + { + self.print.infoln(format!("{}", status)); + } + } + } + Err(_) => { + self.print.warnln("Failed to fetch image from Docker Hub."); + self.print.warnln("Attempting to start local quickstart image instead. Please note this image may be out-of-date."); + break; } } }