Skip to content

HF-131 (3/7): a consumer can tell 'no message' from 'empty message' - #1763

Open
marcin-kordas-hoc wants to merge 3 commits into
feat/hf-131-error-messages-outside-interpreterfrom
feat/hf-131-has-message
Open

HF-131 (3/7): a consumer can tell 'no message' from 'empty message'#1763
marcin-kordas-hoc wants to merge 3 commits into
feat/hf-131-error-messages-outside-interpreterfrom
feat/hf-131-has-message

Conversation

@marcin-kordas-hoc

@marcin-kordas-hoc marcin-kordas-hoc commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

What and why

Stacked on #1762. Adds DetailedCellError.hasMessage: boolean.

DetailedCellError.message collapses two different situations into the same '': an error that
never carried a message at all (e.g. a custom function that omitted one — the public CellError
constructor keeps message optional), and an error with a deliberately empty message. A consumer
that needs to tell them apart previously couldn't. hasMessage does: true means a message was
set (even an empty string), false means none was.

Purely additive — no existing consumer of .type/.message/.value/.address needs a code
change. toString()/valueOf() are unaffected (both still return .value only).

Verified

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.hasMessage so callers can distinguish errors that never had a message (e.g. custom CellError without the optional message) from errors with a deliberately empty message — both still expose message as ''.

The flag is set in the DetailedCellError constructor from whether CellError.message was undefined; existing fields and toString() / valueOf() behavior are unchanged. The custom-functions guide and changelog document the distinction; test toEqualError matchers ignore hasMessage in 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.

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>
@qunabu

qunabu commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread CHANGELOG.md

### 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Triggered by learned rule: CHANGELOG bullets need a PR link

Reviewed by Cursor Bugbot for commit 07bbd58. Configure here.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 10, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

Performance comparison of head (5ed0aec) vs base (749044d)

                                     testName |    base |    head | change
--------------------------------------------------------------------------
                                      Sheet A |  489.74 |  491.95 | +0.45%
                                      Sheet B |  154.64 |  161.22 | +4.26%
                                      Sheet T |  139.42 |  141.49 | +1.48%
                                Column ranges |  470.13 |  471.05 | +0.20%
                                Sorted lookup | 14084.1 | 14432.3 | +2.47%
Sheet A:  change value, add/remove row/column |    15.8 |   15.77 | -0.19%
 Sheet B: change value, add/remove row/column |  138.81 |  126.75 | -8.69%
                   Column ranges - add column |   158.4 |  148.47 | -6.27%
                Column ranges - without batch |   473.9 |  463.16 | -2.27%
                        Column ranges - batch |  116.04 |  114.67 | -1.18%

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.34%. Comparing base (749044d) to head (5ed0aec).

Additional details and impacted files

Impacted file tree graph

@@                               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           
Files with missing lines Coverage Δ
src/CellValue.ts 80.00% <100.00%> (+2.22%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants