diff --git a/packages/cli/src/lib/dsn/fs-utils.ts b/packages/cli/src/lib/dsn/fs-utils.ts index 50ae0231cb..e48b26e5cc 100644 --- a/packages/cli/src/lib/dsn/fs-utils.ts +++ b/packages/cli/src/lib/dsn/fs-utils.ts @@ -19,6 +19,7 @@ import * as Sentry from "@sentry/node-core/light"; * - ENOTDIR: A path component is not a directory (e.g., `/file.txt/child`) * - EINVAL: Invalid argument (e.g., scandir on a special/virtual filesystem entry like /proc paths) * - ELOOP: Too many symbolic links (e.g., cyclic symlink encountered during scan) + * - ETIMEDOUT: Connection timed out (e.g., transient read on a network or cloud-mounted filesystem) * * All other errors are unexpected and should be reported to Sentry. * @@ -35,7 +36,8 @@ function isIgnorableFileError(error: unknown): boolean { code === "EISDIR" || code === "ENOTDIR" || code === "EINVAL" || - code === "ELOOP" + code === "ELOOP" || + code === "ETIMEDOUT" ); } return false; diff --git a/packages/cli/test/lib/dsn/fs-utils.test.ts b/packages/cli/test/lib/dsn/fs-utils.test.ts index 2371b215f2..d8edd1a7ac 100644 --- a/packages/cli/test/lib/dsn/fs-utils.test.ts +++ b/packages/cli/test/lib/dsn/fs-utils.test.ts @@ -77,6 +77,14 @@ describe("handleFileError", () => { }); expect(captureException).not.toHaveBeenCalled(); }); + + test("ETIMEDOUT — connection timed out on a network mount", () => { + handleFileError(errnoError("ETIMEDOUT"), { + operation: "scandir", + path: "/mnt/cloud-storage", + }); + expect(captureException).not.toHaveBeenCalled(); + }); }); describe("unexpected errors (SHOULD report to Sentry)", () => {