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>
This commit is contained in:
google-labs-jules[bot] 2026-08-09 10:24:57 +00:00
parent c958f30662
commit d0c1865e31

View file

@ -137,8 +137,8 @@ export class SumEngine {
// a line without a result beats a dead sheet — swallow everything, // a line without a result beats a dead sheet — swallow everything,
// including extension bugs and BigInt conversion errors // including extension bugs and BigInt conversion errors
} catch (e) { } catch (e) {
if (e instanceof XRefError) lineError = e.message; lineError = e instanceof Error ? e.message : String(e);
else if (!(e instanceof EvalError)) console.warn("evaluate failed:", e); if (!(e instanceof EvalError)) console.warn("evaluate failed:", e);
value = null; value = null;
} }
if (value?.kind === "quantity" && !value.value.isFinite()) value = null; if (value?.kind === "quantity" && !value.value.isFinite()) value = null;