Skip to content

Add helper macros to Rust - #7014

Open
logan-gatlin wants to merge 1 commit into
mainfrom
logan/jsg-rust-macros
Open

Add helper macros to Rust#7014
logan-gatlin wants to merge 1 commit into
mainfrom
logan/jsg-rust-macros

Conversation

@logan-gatlin

@logan-gatlin logan-gatlin commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Add kj::KjError construction macros

Adds Rust macros for building cxx::KjError values, mirroring C++'s
KJ_EXCEPTION/KJ_FAIL_REQUIRE/KJ_UNIMPLEMENTED macros (kj/debug.h). One
pair per kj::Exception::Type variant: a construct-only macro that evaluates
to a KjError value, and an early-return macro that does return Err(...)
from the enclosing function.

KJ exception type Construct-only Early-return
Failed kj::failed! kj::fail_require!
Overloaded kj::overloaded! kj::overloaded_require!
Disconnected kj::disconnected! kj::disconnected_require!
Unimplemented kj::not_implemented! kj::not_implemented_require!

The Unimplemented pair is named not_implemented! rather than
unimplemented! to avoid shadowing std::unimplemented! at any use kj::unimplemented; import site.

@logan-gatlin
logan-gatlin requested review from a team as code owners August 14, 2026 17:54
@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

2 similar comments
@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

@logan-gatlin Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@logan-gatlin
logan-gatlin force-pushed the logan/jsg-rust-macros branch from 35c5d62 to 6efde75 Compare August 14, 2026 18:12
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.79%. Comparing base (78f2814) to head (6efde75).
⚠️ Report is 33 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7014      +/-   ##
==========================================
- Coverage   68.49%   67.79%   -0.70%     
==========================================
  Files         438      468      +30     
  Lines      130184   132593    +2409     
  Branches    21422    21515      +93     
==========================================
+ Hits        89167    89897     +730     
- Misses      27977    29594    +1617     
- Partials    13040    13102      +62     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

3 participants