Skip to content

fix(connectors): wrap fetch transport failures in the typed error class#155

Merged
suleimansh merged 1 commit into
mainfrom
fix/connectors-fetch-errors
Jul 2, 2026
Merged

fix(connectors): wrap fetch transport failures in the typed error class#155
suleimansh merged 1 commit into
mainfrom
fix/connectors-fetch-errors

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Closes #148.

gh/gd/gdText only wrapped non-2xx responses in GitHubError/GoogleDriveError. A fetch() rejection (DNS failure, timeout, offline) escaped as a raw TypeError, so callers couldn't handle transport failures through the same typed class.

Each fetch call site is now routed through a small ghFetch/gdFetch helper that rethrows transport failures as the connector's error type with status: 0.

Tests: one transport-failure test per connector asserting instanceof <Error>, status === 0, and a network error message. pnpm typecheck + pnpm test green (github 8, drive 12). Patch changeset for both connectors.

Disjoint from #146/#147 (touches only client.ts).

gh/gd/gdText only wrapped non-2xx responses; a fetch() rejection (DNS, timeout,
offline) escaped as a raw TypeError. Each fetch call site now rethrows
transport failures as GitHubError/GoogleDriveError with status 0.

Closes #148
@suleimansh suleimansh added bug Something isn't working priority: medium Worth doing, not urgent labels Jul 2, 2026
@suleimansh suleimansh self-assigned this Jul 2, 2026
@suleimansh suleimansh merged commit eaa667c into main Jul 2, 2026
2 checks passed
@suleimansh suleimansh deleted the fix/connectors-fetch-errors branch July 2, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: medium Worth doing, not urgent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

connectors: fetch rejections escape as raw TypeError, bypassing the typed error class

1 participant