From d0c1865e31a1151d8f0f2bcbc21ea309e9f407f6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 9 Aug 2026 10:24:57 +0000 Subject: [PATCH] fix: surface non-EvalError exceptions in evaluation engine Currently, the evaluation engine completely swallows unexpected errors (like extension bugs or BigInt conversion errors), mapping them to a silent failure and warning in the console. This changes it so that all errors are caught to avoid dead sheets, but their messages are surfaced in `lineError` so they appear in the UI, giving the user visibility into what went wrong. Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com> --- src/engine/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/index.ts b/src/engine/index.ts index 0a3d5e3..77c16ec 100644 --- a/src/engine/index.ts +++ b/src/engine/index.ts @@ -137,8 +137,8 @@ export class SumEngine { // a line without a result beats a dead sheet — swallow everything, // 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); + lineError = e instanceof Error ? e.message : String(e); + if (!(e instanceof EvalError)) console.warn("evaluate failed:", e); value = null; } if (value?.kind === "quantity" && !value.value.isFinite()) value = null;