mirror of
https://github.com/Horizontal42/summarum.git
synced 2026-11-10 23:51:59 +03:00
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:
parent
c958f30662
commit
d0c1865e31
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue