Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#3879 auth login browser flow prints a fatal stack trace when swamp-club cannot be reached

Opened by stack72 · 10/24/2026· Shipped 10/24/2026

On a terminal, swamp auth login (browser flow) against a swamp-club it cannot reach ends in a fatal stack trace instead of a clean error. Seen on release 20261023.123914.0-sha.8540c1e3 while checking swamp-club#3831.

Steps to reproduce:

  1. On a terminal with no stored credentials and no SWAMP_API_KEY set, run SWAMP_CLUB_URL=http://localhost:1 swamp auth login.
  2. The output is fatal error TypeError: Fetch failed: Requests to port 1 are blocked followed by a stack trace through Object.startDeviceAuth.

Expected: a one-line error like the --no-browser path gives for the same server, which prints Error: Could not connect to http://localhost:1: ... and exits 1.

Cause: in src/libswamp/auth/login.ts, createAuthLoginDeps().startDeviceAuth calls fetch directly. A network failure, or the 10-second AbortSignal.timeout firing, is thrown as a raw TypeError or DOMException rather than a UserError. authLogin calls startDeviceAuth outside any try block, so the error escapes to the top-level fatal handler. The username/password path goes through SwampClubClient, which already maps connection failures to "Could not connect to ...". The same check applies to pollDeviceToken: its errors are caught in the polling loop, but a network failure there is reported with code unknown and the raw message.

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 9 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

10/24/2026, 2:10:43 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack7210/24/2026, 1:34:28 AM

Sign in to post a ripple.