fix(get.ps1): show error instead of silently swallowing all failures #4

Merged
amiryahaya merged 1 commit from fix/get-ps1-swallowed-errors into main 2026-07-24 14:32:19 +02:00
Owner

A completely bare, silent catch-all at the top level of the script: try { Invoke-TritonInstaller @args } catch { }. The sibling agent installer (agent/get.ps1) had this exact anti-pattern and it was fixed there (commit ae575d7, "show error instead of silently swallowing all failures") — the fix was never carried over to this script.

Most expected failure paths in this script already print via Write-Die before throwing, so the practical exposure is narrower than it looks — but any unexpected .NET/cmdlet exception not routed through Write-Die (e.g. a raw exception from Invoke-WebRequest during a connectivity/TLS problem while downloading install.ps1/compose.yaml) would be swallowed with zero output, leaving the operator with a script that silently did nothing.

Fix

Applies the exact fix already used in agent/get.ps1, verbatim. This top-level bootstrapper has no SCRIPT_VERSION constant to bump (unlike agent/get.ps1), so none is added here.

Verification

  • Verified via PowerShell Core's own parser (no live Windows box in this environment): no syntax errors
  • One-line change, byte-for-byte identical to the already-reviewed-and-shipped fix in the sibling script — no separate code review dispatched given the exact precedent

Fixes amiryahaya/triton#338

A completely bare, silent catch-all at the top level of the script: `try { Invoke-TritonInstaller @args } catch { }`. The sibling agent installer (`agent/get.ps1`) had this exact anti-pattern and it was fixed there (commit ae575d7, "show error instead of silently swallowing all failures") — the fix was never carried over to this script. Most expected failure paths in this script already print via `Write-Die` before throwing, so the practical exposure is narrower than it looks — but any unexpected .NET/cmdlet exception not routed through `Write-Die` (e.g. a raw exception from `Invoke-WebRequest` during a connectivity/TLS problem while downloading `install.ps1`/`compose.yaml`) would be swallowed with zero output, leaving the operator with a script that silently did nothing. ## Fix Applies the exact fix already used in `agent/get.ps1`, verbatim. This top-level bootstrapper has no `SCRIPT_VERSION` constant to bump (unlike `agent/get.ps1`), so none is added here. ## Verification - Verified via PowerShell Core's own parser (no live Windows box in this environment): no syntax errors - One-line change, byte-for-byte identical to the already-reviewed-and-shipped fix in the sibling script — no separate code review dispatched given the exact precedent Fixes amiryahaya/triton#338
A completely bare, silent catch-all at the top level of the script.
The sibling agent installer (agent/get.ps1) had this exact anti-pattern
and it was fixed there (commit ae575d7, "show error instead of
silently swallowing all failures") — the fix was never carried over to
this script.

Most expected failure paths in this script already print via Write-Die
before throwing, so the practical exposure is narrower than it looks —
but any unexpected .NET/cmdlet exception not routed through Write-Die
(e.g. a raw exception from Invoke-WebRequest during a connectivity/TLS
problem while downloading install.ps1/compose.yaml) would be swallowed
with zero output, leaving the operator with a script that silently did
nothing.

Applies the exact fix already used in agent/get.ps1. This top-level
bootstrapper has no SCRIPT_VERSION constant to bump (unlike
agent/get.ps1), so none is added here.

Verified via PowerShell Core's own parser (no live Windows box in this
environment): no syntax errors introduced.

Fixes amiryahaya/triton#338
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
primatekuntech/triton-install!4
No description provided.