Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

fix(error-reporting): silence undici TypeError: terminated network errors (CLI-2AD) - #1653

Closed
sentry[bot] wants to merge 2 commits into
mainfrom
seer/fix/cli-2ad-silence-terminated
Closed

sentry[bot] wants to merge 2 commits into
mainfrom
seer/fix/cli-2ad-silence-terminated

Conversation

@sentry

@sentry sentry Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Previously, when a network connection dropped after response headers but before the full body was received, Node.js's fetch (undici) would throw a TypeError: terminated. These errors were not being silenced by the CLI's error reporting mechanism because isNetworkError() only checked for TypeError: "fetch failed".

This meant that environmental network issues were being reported to Sentry as if they were CLI bugs.

This change extends isNetworkError() to also recognize TypeError: "terminated" as a network error. This ensures that such errors are correctly classified as network_error and silenced, consistent with the intent to not report user-environment-related network failures. JSDoc comments have been updated to reflect this behavior, and new tests have been added to cover the terminated error type.

Fixes CLI-2AD

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Oct 1, 2026 11:24pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Oct 1, 2026 11:24pm UTC

Request Review

@sentry-junior

sentry-junior Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Closing as part of archiving getsentry/cli; the CLI now lives in getsentry/toolkit. Ported as getsentry/toolkit#1606, minus the regenerated date examples in the skill references.

@sentry-junior sentry-junior Bot closed this Oct 22, 2026
BYK added a commit to getsentry/toolkit that referenced this pull request Oct 23, 2026
…1606)

Two kinds of user-environment failures still show up in Sentry as CLI
issues:

- **`TypeError: terminated`**
([CLI-2AD](https://sentry.sentry.io/issues/7624167935/)): undici throws
this when the connection drops while the response body is streaming.
#1548 already retries finite GET bodies, so one that still gets through
is the same offline/proxy noise as `fetch failed`. `isNetworkError()`
now matches it too.
- **Bad sourcemap directory**
([CLI-1FN](https://sentry.sentry.io/issues/7439660891/)):
`assertDirectoryReadable` throws a `ValidationError` with field
`"directory"` when the directory doesn't exist, isn't a directory, or
can't be read. This is now silenced the same way as the missing
`--input` file case (CLI-1JY).

The original getsentry/cli#1616 silenced **every** `ValidationError` and
changed `paginate()` back to fixed page sizes. That conflicts with the
targeted silencing policy here and with getsentry/cli#1615, so this port
only covers the sourcemap directory case.

Ported from getsentry/cli#1653 and getsentry/cli#1616, which are being
closed with the repo archive.

<!-- junior-request-attribution:start -->
via **BYK**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3Ad9c5b0de1ecf3c7114be7025 -->

--

[View Junior Session in
Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3Ad9c5b0de1ecf3c7114be7025/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <burak.kaya@sentry.io>

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — 8f7e30f6 Deployed Oct 1, 2026 by vercel[bot]
Preview – sentry-local — 8f7e30f6 Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants