From 8238c56b3f885a1b6edd6ff30dbae63e50fc29d1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-RTLN3BA\\$punk" Date: Tue, 3 Mar 2026 12:56:07 -0800 Subject: [PATCH] fix: improve error handling in Docker installation script for Windows by using try-finally blocks --- docker/scripts/install.ps1 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docker/scripts/install.ps1 b/docker/scripts/install.ps1 index 61089f93a..f97c8482e 100644 --- a/docker/scripts/install.ps1 +++ b/docker/scripts/install.ps1 @@ -51,13 +51,23 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) { } Write-Ok "Docker found." -docker info *>$null +try { + $ErrorActionPreference = 'Continue' + docker info *>$null +} finally { + $ErrorActionPreference = 'Stop' +} if ($LASTEXITCODE -ne 0) { Write-Err "Docker daemon is not running. Please start Docker Desktop and try again." } Write-Ok "Docker daemon is running." -docker compose version *>$null +try { + $ErrorActionPreference = 'Continue' + docker compose version *>$null +} finally { + $ErrorActionPreference = 'Stop' +} if ($LASTEXITCODE -ne 0) { Write-Err "Docker Compose is not available. It should be bundled with Docker Desktop." }