From 0c881eaaeba6a89253a31fd1e3834355df147d3b Mon Sep 17 00:00:00 2001 From: Jamie Nelson Date: Sun, 11 Oct 2026 07:58:09 +1100 Subject: [PATCH] fix: preserve original file read error as cause --- src/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.ts b/src/helpers.ts index 4f16f585..f381d782 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -153,7 +153,7 @@ export function readFile(filename: string): string { try { return readFileSync(filename, 'utf8'); } catch (error) { - throw new Error(`Cannot read file ${filename}: ${String(error)}`); + throw new Error(`Cannot read file ${filename}: ${String(error)}`, { cause: error }); } }