Repository navigation
fix(browser): BrowserDb errors carry their error code (#673) — backport - #677
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onmain) goes through a newto_js_error(MinigrafError::from(e).to_string()), and the existing flush-error path uses it too. Theexecute_errors_carry_their_codebrowser test comes over as well. CHANGELOG: an entry under Unreleased › Fixed.mainhas no CI job that runs the browser tests. I ran them locally withcargo test --target wasm32-unknown-unknown --features browser --libunderwasm-bindgen-test-runnerin 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/browserreport error codes, which the WASM consumer test checks.🤖 Generated with Claude Code
https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz