Back to Explore

sindresorhus/is-network-error

GitHub
1 watchersOpen source

Last release:

This software provides a function to check whether a given value is a Fetch network error, helping you handle network failures separately from other Fetch-related errors. It includes logic to account for differences across Node.js, Bun, Deno, and browsers.

Project status

  • Actively maintained, with the most recent update on 2026-05-08, and prior updates also occurring within the last couple of years (2026-02-26, 2025-09-18).
  • Update cadence looks ongoing but not tightly frequent, with gaps of about 2 to 3 months between 2026-02 and 2026-05, and about 7 months between 2025-09 and 2026-02.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v1.3.2

    v1.3.2 updates `is-network-error` to better recognize Safari network errors when the error message includes a domain. The main logic change expands the Safari detection condition and adds corresponding test coverage.

  • v1.3.1

    v1.3.1 updates is-network-error to correctly detect Chrome fetch network errors when Chrome appends the hostname to the error message. The change is implemented in index.js and verified with new tests for both the hostname-suffixed format and non-matching “Failed to fetch ...” messages.

  • v1.3.0

    v1.3.0 adds support for detecting Cloudflare Workers fetch network errors. Specifically, it extends the internal set of known network error message strings to include an additional Cloudflare Workers message.

    Features
  • v1.2.0

    v1.2.0 extends is-network-error to recognize additional Fetch network error patterns from Bun and Deno. It also updates detection logic to improve compatibility with Sentry. The main implementation changes are in index.js, plus documentation and tests.

    Features
  • v1.1.0

    v1.1.0 updates the network error detection to also recognize Undici termination errors. The change adds the string 'terminated' to the set of error message tokens that cause `isNetworkError` to return true.

    Features
  • v1.0.1

    v1.0.1 expands the network error detection heuristics by recognizing an additional error message string, 'network error' (noted as Chrome). The release notes only mention this behavior change, but the diff also includes metadata and CI workflow updates.

    Features
  • v1.0.0

    The v1.0.0 release notes provided contain no substantive information beyond a placeholder emoji. No details are available here to identify new features, breaking changes, bug fixes, security updates, performance improvements, or migration steps.