Skip to content

Commit d43f971

Browse files
authored
[ps-installation-script] better error message in case of failed instrumentation installer download (#6165)
1 parent dc9b260 commit d43f971

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packaging/installer/install.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,17 @@ if ($with_dotnet_instrumentation) {
456456
$download = "https://github.com/signalfx/splunk-otel-dotnet/releases/latest/download/$module_name"
457457
$dotnet_autoinstr_path = Join-Path $tempdir $module_name
458458
echo "Downloading .NET Instrumentation installer ..."
459-
Invoke-WebRequest -Uri $download -OutFile $dotnet_autoinstr_path -UseBasicParsing
459+
try {
460+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
461+
Invoke-WebRequest -Uri $download -OutFile $dotnet_autoinstr_path -UseBasicParsing
462+
} catch {
463+
$err = $_.Exception.Message
464+
$message = "
465+
An error occured when trying to download .NET Instrumentation installer from $download. This may be due to a network connectivity issue.
466+
$err
467+
"
468+
throw "$message"
469+
}
460470
Import-Module $dotnet_autoinstr_path
461471
} else {
462472
$dotnet_autoinstr_path = $dotnet_psm1_path

0 commit comments

Comments
 (0)