Skip to content

Replace bun_core::Error intern machinery with per-crate thiserror enums - #33909

Merged
Jarred-Sumner merged 38 commits into
mainfrom
claude/err-thiserror-refactor
Jul 11, 2026
Merged

Replace bun_core::Error intern machinery with per-crate thiserror enums#33909
Jarred-Sumner merged 38 commits into
mainfrom
claude/err-thiserror-refactor

[autofix.ci] apply automated fixes

be52741
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 11, 2026 in 18m 10s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/jsc/AsyncModule.rs:724-728 Js() / Bundler(Js()) dispatch over-captures JsError::OutOfMemory → take_error(Thrown) panics

Annotations

Check warning on line 728 in src/jsc/AsyncModule.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Js(_) / Bundler(Js(_)) dispatch over-captures JsError::OutOfMemory → take_error(Thrown) panics

The `Js(_)` / `Bundler(Js(_))` wildcards here (and at jsc_hooks.rs:4414-4418 / :4591-4595) now over-capture `JsError::OutOfMemory` — which carries no pending exception on the VM — but all three sites hardcode `take_error(JsError::Thrown)`, whose `Thrown` arm skips `throw_out_of_memory()` and goes straight to `try_take_exception().unwrap_or_else(|| panic!(...))`. Pre-PR, `JsError::OutOfMemory.into()` yielded `err!("OutOfMemory")` ≠ `err!("JSError")` and fell through to `process_fetch_log`. Fix: b