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:
- On a terminal with no stored credentials and no SWAMP_API_KEY set, run
SWAMP_CLUB_URL=http://localhost:1 swamp auth login. - The output is
fatal error TypeError: Fetch failed: Requests to port 1 are blockedfollowed by a stack trace throughObject.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.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.