From 8ba7e2b210941c982c73393338e2ccacaa3d6ed8 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 17 Aug 2024 13:49:21 +0200 Subject: [PATCH] Emit errors using `Write-Error` --- scripts/Common/Scripts/BrowserAutomation.ps1 | 4 ++-- scripts/Common/Scripts/Operations.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Common/Scripts/BrowserAutomation.ps1 b/scripts/Common/Scripts/BrowserAutomation.ps1 index 9dd153fb..731d8072 100644 --- a/scripts/Common/Scripts/BrowserAutomation.ps1 +++ b/scripts/Common/Scripts/BrowserAutomation.ps1 @@ -110,7 +110,7 @@ $null = New-Module { $result; } catch { - throw $Error; + Write-Error $Error; } } } @@ -156,7 +156,7 @@ $null = New-Module { if ($element) { $Browser.FindElement([OpenQA.Selenium.By]::CssSelector($ButtonSelector)).Click(); } else { - throw "Unable to find download button!"; + Write-Error "Unable to find download button!"; } }; } diff --git a/scripts/Common/Scripts/Operations.ps1 b/scripts/Common/Scripts/Operations.ps1 index 09095ad1..c3e07bd3 100644 --- a/scripts/Common/Scripts/Operations.ps1 +++ b/scripts/Common/Scripts/Operations.ps1 @@ -113,7 +113,7 @@ $null = New-Module { if (Test-Path $errorPath) { $errorMessage = Get-Content $errorPath; Remove-Item $errorPath; - throw $errorMessage; + Write-Error $errorMessage; } }