Skip to content

fix(browser): BrowserDb errors carry their error code (#673) — backport - #677

Merged
adityamukho merged 2 commits into
mainfrom
fix/673-browser-error-codes-main
Oct 21, 2026
Merged

adityamukho merged 2 commits into
mainfrom
fix/673-browser-error-codes-main

Conversation

@adityamukho

Copy link
Copy Markdown
Collaborator

Backport of #675 (v3) to main, for v2.0.9. Refs #673.

The same change: every anyhow conversion in src/browser/mod.rs (12 sites on main) goes through a new to_js_error (MinigrafError::from(e).to_string()), and the existing flush-error path uses it too. The execute_errors_carry_their_code browser test comes over as well. CHANGELOG: an entry under Unreleased › Fixed.

main has no CI job that runs the browser tests. I ran them locally with cargo test --target wasm32-unknown-unknown --features browser --lib under wasm-bindgen-test-runner in headless Firefox: 12 passed, including the new test.

Why it goes to 2.0.x: the v2.0.x line gets every bug fix until v3.0.0. This one makes @minigraf/browser report error codes, which the WASM consumer test checks.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz

adityamukho and others added 2 commits October 21, 2026 11:47
BrowserDb rejected with the anyhow error's top-level message only
("Unknown command: nosuchcommand"), so the browser API was the one API
without structured codes. Every anyhow conversion now goes through
to_js_error (MinigrafError::from), so a rejection starts with its code, as
on every other API. A browser test checks a parse, query and transact error.

Found by the minigraf-wasm consumer test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit f7ea990 into main Oct 21, 2026
22 checks passed
@adityamukho
adityamukho deleted the fix/673-browser-error-codes-main branch October 21, 2026 06:49
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.

1 participant