From 1872c4b1595e50a2ffd22799ff5a196122641277 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 23:48:34 +0000 Subject: [PATCH] Fix: Surface evaluation failures to avoid hiding bugs Modifies `src/engine/index.ts` to surface unhandled evaluation errors. Previously, generic exceptions were completely silenced, masking bugs or `BigInt` conversion errors. Now, `EvalError` exceptions correctly populate the `lineError` so they are surfaced in the UI without crashing the sheet. Other generic runtime errors are also captured and output to the UI and console. `XRefError` exceptions are preserved and behave identically as before. Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com> --- src/engine/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/engine/index.ts b/src/engine/index.ts index 0a3d5e3..3997e28 100644 --- a/src/engine/index.ts +++ b/src/engine/index.ts @@ -138,7 +138,11 @@ export class SumEngine { // including extension bugs and BigInt conversion errors } catch (e) { if (e instanceof XRefError) lineError = e.message; - else if (!(e instanceof EvalError)) console.warn("evaluate failed:", e); + else if (e instanceof EvalError) lineError = e.message; + else { + console.warn("evaluate failed:", e); + lineError = e instanceof Error ? e.message : String(e); + } value = null; } if (value?.kind === "quantity" && !value.value.isFinite()) value = null;