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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- The CLI no longer sends an error report when a write fails with an input/output error (EIO). For example, this occurs when the terminal closes or the SSH session drops while a command runs. The CLI handles the error in the same way as before.

## [1.31.0] - 2026-11-11

### Added
Expand Down
3 changes: 3 additions & 0 deletions cloudsmith_cli/core/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
``sentry_sdk`` must only ever be imported inside :func:`_send`.
"""

import errno
import os
import platform
import re
Expand Down Expand Up @@ -149,10 +150,12 @@ def is_reportable(exc: BaseException) -> bool:
``report_to_telemetry = False``. Checked by attribute rather than by
importing the types, so this module stays light on the error path. A failed
TLS certificate check is a problem with the network, not with the CLI.
An EIO error comes from the device, such as a terminal that hung up.
"""
return (
getattr(exc, REPORTABLE_ATTR, True) is not False
and find_certificate_error(exc) is None
and not (isinstance(exc, OSError) and exc.errno == errno.EIO)
)


Expand Down
9 changes: 9 additions & 0 deletions cloudsmith_cli/core/tests/test_telemetry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests for error reporting: opt-out controls, sending, and anonymisation."""

import errno
import importlib.util
import json
import socket
Expand Down Expand Up @@ -154,6 +155,14 @@ class SpecificUserError(UserError):
assert sentry_events == []


def test_device_io_errors_are_not_reported(sentry_events):
"""A terminal that hangs up mid-command fails the next write with EIO."""
exc = raise_and_catch(OSError(errno.EIO, "Input/output error"))

assert telemetry.report_exception(exc) is False
assert sentry_events == []


def test_exceptions_are_reportable_by_default():
assert telemetry.is_reportable(RuntimeError("boom")) is True

Expand Down
Loading