From bcb797f9dab0a85b0e54229e7580723e793ac43d Mon Sep 17 00:00:00 2001 From: Mateusz Lach Date: Tue, 22 Apr 2025 13:29:12 +0200 Subject: [PATCH] improve error message --- packaging/installer/install.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packaging/installer/install.ps1 b/packaging/installer/install.ps1 index 2f45fe0245..8c15a86c15 100644 --- a/packaging/installer/install.ps1 +++ b/packaging/installer/install.ps1 @@ -456,7 +456,17 @@ if ($with_dotnet_instrumentation) { $download = "https://github.com/signalfx/splunk-otel-dotnet/releases/latest/download/$module_name" $dotnet_autoinstr_path = Join-Path $tempdir $module_name echo "Downloading .NET Instrumentation installer ..." - Invoke-WebRequest -Uri $download -OutFile $dotnet_autoinstr_path -UseBasicParsing + try { + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + Invoke-WebRequest -Uri $download -OutFile $dotnet_autoinstr_path -UseBasicParsing + } catch { + $err = $_.Exception.Message + $message = " + An error occured when trying to download .NET Instrumentation installer from $download. This may be due to a network connectivity issue. + $err + " + throw "$message" + } Import-Module $dotnet_autoinstr_path } else { $dotnet_autoinstr_path = $dotnet_psm1_path