diff options
author | Robert Adam <dev@robert-adam.de> | 2020-01-30 20:47:56 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2020-04-04 17:54:21 +0300 |
commit | 551f061529b3bbb5dd51cdc64c13cfa9a5665d2a (patch) | |
tree | af965a07f5e6f75c292f8de9eebad2d7362da60a /scripts | |
parent | 552592ad4294f74516a5ef6675cb7096b62974cb (diff) |
scripts/azure-pipelines/install-environment.ps1: Surround Invoke-WebRequest with try/catch to display error message on failure
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/azure-pipelines/install-environment.ps1 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/azure-pipelines/install-environment.ps1 b/scripts/azure-pipelines/install-environment.ps1 index 22902f626..e405adc1e 100644 --- a/scripts/azure-pipelines/install-environment.ps1 +++ b/scripts/azure-pipelines/install-environment.ps1 @@ -37,7 +37,12 @@ $env_7z = Join-Path $MUMBLE_ENVIRONMENT_STORE "$MUMBLE_ENVIRONMENT_VERSION.7z"; if (-Not (Test-Path $env_7z)) { Write-Host "Environment not cached. Downloading..." $env_url = "$MUMBLE_ENVIRONMENT_SOURCE/$MUMBLE_ENVIRONMENT_VERSION.7z" - Invoke-WebRequest -Uri $env_url -OutFile $env_7z + try { + Invoke-WebRequest -Uri $env_url -OutFile $env_7z + } catch { + Write-Host "Failed at downloading build-environment: $PSItem" + exit 1 + } } if (-Not (Test-Path (Join-Path $MUMBLE_ENVIRONMENT_PATH $MUMBLE_ENVIRONMENT_VERSION))) { |