fix: enhance error handling in migrate-database.ps1 by implementing try-finally for Docker info command

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2026-03-03 13:00:10 -08:00
parent 8238c56b3f
commit 59d8afca4f

View file

@ -129,7 +129,12 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Err "Docker is not installed. Install Docker Desktop: https://docs.docker.com/desktop/install/windows-install/"
}
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."
}