Emit errors using Write-Error
This commit is contained in:
parent
8d7835a8aa
commit
9e716bce4f
2 changed files with 3 additions and 3 deletions
|
@ -110,7 +110,7 @@ $null = New-Module {
|
||||||
$result;
|
$result;
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
throw $Error;
|
Write-Error "$Error";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ $null = New-Module {
|
||||||
if ($element) {
|
if ($element) {
|
||||||
$Browser.FindElement([OpenQA.Selenium.By]::CssSelector($ButtonSelector)).Click();
|
$Browser.FindElement([OpenQA.Selenium.By]::CssSelector($ButtonSelector)).Click();
|
||||||
} else {
|
} else {
|
||||||
throw "Unable to find download button!";
|
Write-Error "Unable to find download button!";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ $null = New-Module {
|
||||||
if (Test-Path $errorPath) {
|
if (Test-Path $errorPath) {
|
||||||
$errorMessage = Get-Content $errorPath;
|
$errorMessage = Get-Content $errorPath;
|
||||||
Remove-Item $errorPath;
|
Remove-Item $errorPath;
|
||||||
throw $errorMessage;
|
Write-Error $errorMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue