HF-131 (3/7): a consumer can tell 'no message' from 'empty message' - #1763
HF-131 (3/7): a consumer can tell 'no message' from 'empty message'#1763marcin-kordas-hoc wants to merge 3 commits into
Conversation
After Tasks 1-2 no engine-produced cell error is message-less, but a custom
function may still return new CellError('VALUE') with no message -- the
documented, still-supported contract. Both cases used to surface identically
as message: ''. DetailedCellError.hasMessage (own enumerable, readonly)
tells them apart: true means a message was set, even a deliberately empty
one; false means none was.
test/_setupFiles/matchers/cellErrorComparison.ts already exists as the
single shared strip-list both toEqualError implementations import (built
during the origin-mechanism work, ahead of this task) -- extended with one
line rather than introducing the second shared-file layout the original
plan draft described, since duplicating the consolidation this task already
has would reopen the exact drift risk that shared module exists to close.
Verified the strip-list entry is load-bearing empirically, not by trusting
the plan's synthetic probe: removing 'hasMessage: undefined' from the list
and running the full suite produces 446 failures; restoring it returns to
baseline.
docs/guide/custom-functions.md gains the note this field's own PR owes it,
per the plan's explicit instruction not to defer a field's documentation to
a later task.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Task linked: HF-131 Verbose and actionable formula error messages |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 07bbd58. Configure here.
|
|
||
| ### Added | ||
|
|
||
| - Added `DetailedCellError.hasMessage`, so a consumer can tell a cell error that never carried a message (e.g. a custom function that omitted one) apart from one with a deliberately empty message — both previously surfaced identically as `message: ''`. [#131](https://github.com/handsontable/hyperformula/issues/131) |
There was a problem hiding this comment.
Changelog uses issue not PR link
Low Severity
The new Unreleased changelog bullet ends with an issue link for #131 rather than a pull-request link.
Triggered by learned rule: CHANGELOG bullets need a PR link
Reviewed by Cursor Bugbot for commit 07bbd58. Configure here.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | 5ed0aec | Commit Preview URL Branch Preview URL |
Sep 11 2026, 05:35 AM |
Performance comparison of head (5ed0aec) vs base (749044d) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/hf-131-error-messages-outside-interpreter #1763 +/- ##
===============================================================================
Coverage 97.34% 97.34%
===============================================================================
Files 195 195
Lines 15825 15826 +1
Branches 3491 3491
===============================================================================
+ Hits 15405 15406 +1
Misses 412 412
Partials 8 8
🚀 New features to boost your workflow:
|


What and why
Stacked on #1762. Adds
DetailedCellError.hasMessage: boolean.DetailedCellError.messagecollapses two different situations into the same'': an error thatnever carried a message at all (e.g. a custom function that omitted one — the public
CellErrorconstructor keeps
messageoptional), and an error with a deliberately empty message. A consumerthat needs to tell them apart previously couldn't.
hasMessagedoes:truemeans a message wasset (even an empty string),
falsemeans none was.Purely additive — no existing consumer of
.type/.message/.value/.addressneeds a codechange.
toString()/valueOf()are unaffected (both still return.valueonly).Verified
npx tsc --noEmit— cleannpx eslint src/— 0 errorspre-existing branch-pinning mismatch as HF-131 (1/7): every interpreter cell error carries a message #1761/HF-131 (2/7): the origin/propagation mechanism, plus the same guarantee outside the interpreter #1762
Stack
3 of 7 — stacked on #1762. Next:
feat/hf-131-origin-function.🤖 Generated with Claude Code
Note
Low Risk
Additive public field on DetailedCellError with no change to existing message or value semantics; low blast radius beyond consumers that opt into hasMessage.
Overview
Adds
DetailedCellError.hasMessageso callers can distinguish errors that never had a message (e.g. customCellErrorwithout the optionalmessage) from errors with a deliberately empty message — both still exposemessageas''.The flag is set in the
DetailedCellErrorconstructor from whetherCellError.messagewasundefined; existing fields andtoString()/valueOf()behavior are unchanged. The custom-functions guide and changelog document the distinction; testtoEqualErrormatchers ignorehasMessagein structural compares so specs that do not assert it keep passing.Reviewed by Cursor Bugbot for commit 5ed0aec. Bugbot is set up for automated code reviews on this repo. Configure here.