Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ List recent agent conversations
**Flags:**
- `-n, --limit <value> - Number of conversations (1-1000) - (default: "25")`
- `-q, --query <value> - Search query`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "7d")`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ View a dashboard
- `-w, --web - Open in browser`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-r, --refresh <value> - Auto-refresh interval in seconds (default: 60, min: 10)`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01"`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01"`
- `--renderer <value> - Graphics renderer (defaults to auto; falls back to auto when unavailable) - (default: "auto")`
- `--no-graphics-cap - Use the terminal-native graphics width (may fall back to ASCII for very large dashboards)`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ List events for an issue
- `-n, --limit <value> - Number of events (1-1000) - (default: "25")`
- `-q, --query <value> - Search query (Sentry search syntax)`
- `--full - Include full event body (stacktraces)`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "7d")`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Query aggregate event data (Explore)
- `-s, --sort <value> - Sort field (prefix with - for desc, e.g., "-count()")`
- `-e, --environment <value>... - Environment filter (repeatable, comma-separated)`
- `-n, --limit <value> - Number of rows (1-1000) - (default: "25")`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "24h")`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01" - (default: "24h")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ List and search User Feedback
- `--status <value> - Mailbox: unresolved, resolved, spam, or all - (default: "unresolved")`
- `-n, --limit <value> - Number of feedback items (1-1000) - (default: "25")`
- `-q, --query <value> - Search query (Sentry issue search syntax)`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "14d")`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01" - (default: "14d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ List issues in a project
- `-q, --query <value> - Search query (Sentry syntax, implicit AND, no OR operator)`
- `-n, --limit <value> - Maximum number of issues to list - (default: "25")`
- `-s, --sort <value> - Sort by: recommended, date, new, freq, user (default: recommended on sentry.io, else date)`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "90d")`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01" - (default: "90d")`
- `-c, --cursor <value> - Pagination cursor (use "next" for next page, "prev" for previous)`
- `--compact - Single-line rows for compact output (auto-detects if omitted)`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
Expand Down Expand Up @@ -92,7 +92,7 @@ List events for a specific issue
- `-n, --limit <value> - Number of events (1-1000) - (default: "25")`
- `-q, --query <value> - Search query (Sentry search syntax)`
- `--full - Include full event body (stacktraces)`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "7d")`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ List logs from a project
- `-n, --limit <value> - Number of log entries (1-1000) - (default: "100")`
- `-q, --query <value> - Filter query (e.g., "severity:error", "project:backend", "project:[a,b]")`
- `-f, --follow <value> - Stream logs (optionally specify poll interval in seconds)`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01"`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01"`
- `-s, --sort <value> - Sort order: "newest" (default) or "oldest" - (default: "newest")`
- `--fresh - Bypass cache, re-detect projects, and fetch fresh data`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ List recent Session Replays
- `-q, --query <value> - Search query (Sentry replay search syntax)`
- `-e, --environment <value>... - Filter by environment (repeatable, comma-separated)`
- `-s, --sort <value> - Sort by: date, oldest, duration, errors, activity, or a raw replay sort field - (default: "date")`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "7d")`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ List spans in a project or trace
- `-n, --limit <value> - Number of spans (<=1000) - (default: "25")`
- `-q, --query <value> - Filter spans (e.g., "op:db", "project:backend", "project:[cli,api]")`
- `-s, --sort <value> - Sort order: date, duration - (default: "date")`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "7d")`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ List recent traces in a project
- `-n, --limit <value> - Number of traces (1-1000) - (default: "25")`
- `-q, --query <value> - Search query (Sentry search syntax)`
- `-s, --sort <value> - Sort by: date, duration - (default: "date")`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "7d")`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01" - (default: "7d")`
- `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data`
- `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)`

Expand Down Expand Up @@ -91,7 +91,7 @@ View logs associated with a trace

**Flags:**
- `-w, --web - Open trace in browser`
- `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "14d")`
- `-t, --period <value> - Time range: "7d", "2026-09-01..2026-10-01", ">=2026-09-01" - (default: "14d")`
- `-n, --limit <value> - Number of log entries (<=1000) - (default: "100")`
- `-q, --query <value> - Filter query (e.g., "severity:error", "project:backend", "project:[a,b]")`
- `-s, --sort <value> - Sort order: "newest" (default) or "oldest" - (default: "newest")`
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/src/lib/error-reporting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ export function classifySilenced(error: unknown): SilenceReason | null {
return "output_error";
}
// A raw `TypeError: "fetch failed"` (CLI-16W) means the CLI could not reach
// Sentry at all (offline, DNS, connection refused/timeout). There is nothing
// Sentry at all (offline, DNS, connection refused/timeout); a raw
// `TypeError: "terminated"` (CLI-2AD) means the connection dropped while
// streaming the response body. There is nothing
// actionable in a "user is offline" report, so drop it — same rationale as
// EPIPE/EBADF OS noise in `beforeSend`. Note: TLS cert errors are wrapped as
// ApiError(status 0), NOT matched here, so they stay captured/actionable.
Expand Down
10 changes: 9 additions & 1 deletion packages/cli/src/lib/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,11 @@ export function toSearchQueryError(
* `TypeError: "fetch failed"` for every such failure (the real errno is in
* `cause`).
*
* When the connection drops *after* response headers arrive (e.g. `read
* ETIMEDOUT` while streaming the body), undici instead aborts the body stream
* with `TypeError: "terminated"` (CLI-2AD). That is the same class of
* environmental failure, so it is matched too.
*
* This reflects the user's environment, not a CLI bug, so it is treated as a
* user error (no upgrade nudge) and is not reported to Sentry — the same
* rationale as dropping EPIPE/EBADF OS noise in `beforeSend`.
Expand All @@ -922,7 +927,10 @@ export function toSearchQueryError(
* CLI bug" treatment for `status === 0` check it explicitly.
*/
export function isNetworkError(error: unknown): boolean {
return error instanceof TypeError && error.message === "fetch failed";
return (
error instanceof TypeError &&
(error.message === "fetch failed" || error.message === "terminated")
);
}

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/test/lib/error-reporting.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ describe("classifySilenced", () => {
);
});

test("silences a raw 'terminated' TypeError (mid-body connection drop)", () => {
const err = new TypeError("terminated", {
cause: new Error("read ETIMEDOUT"),
});
expect(classifySilenced(err)).toBe("network_error");
});

test("does NOT silence a TLS cert error wrapped as ApiError(0)", () => {
// status 0 is shared by network failures and TLS cert errors; the latter
// are actionable (missing CA) and must stay captured.
Expand Down
17 changes: 17 additions & 0 deletions packages/cli/test/lib/errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ describe("isUserError", () => {
new TypeError("fetch failed"),
true,
],
[
"raw terminated TypeError (mid-body network drop)",
new TypeError("terminated"),
true,
],
["ApiError 400", new ApiError("bad request", 400), false],
[
// A user's unparseable --query becomes a ValidationError at the command
Expand Down Expand Up @@ -565,6 +570,18 @@ describe("isNetworkError", () => {
expect(isNetworkError(new TypeError("fetch failed"))).toBe(true);
});

test("true for a raw 'terminated' TypeError (mid-body connection drop)", () => {
const err = new TypeError("terminated", {
cause: new Error("read ETIMEDOUT"),
});
expect(isNetworkError(err)).toBe(true);
expect(isNetworkError(new TypeError("terminated"))).toBe(true);
});

test("false for a plain Error with message 'terminated'", () => {
expect(isNetworkError(new Error("terminated"))).toBe(false);
});

test("false for ApiError status 0 (shared with TLS cert errors)", () => {
// status 0 is also used for TLS cert errors, which must stay actionable.
expect(isNetworkError(new ApiError("Network error", 0))).toBe(false);
Expand Down
Loading