Files
bun.sh/test/js
Claude Bot 749a0737a0 fix(event_loop): handle termination exceptions in handleRejectedPromises
Previously, `handleRejectedPromises()` would panic when encountering
a termination exception (e.g., when a worker is terminated). This caused
unreachable panics during worker termination because the termination
exception could not be cleared by the C++ code's internal exception handling.

This change:
- Changes `handleRejectedPromises` to return `bun.JSTerminated!void`
- Uses `assertNoExceptionExceptTermination` to properly detect termination
- Updates all callers to handle the error appropriately:
  - Most callers use `catch {}` to silently ignore (appropriate for cleanup)
  - Event loop tick uses `catch return` to exit the tick early
  - Test runner uses `catch break` to exit loops

Fixes the panic reported in https://bun.report/1.3.6/Ma1d530ed9gDqgggC2zr+3CukulGmskkGmogsF+wzwiBm752Eu519E2mhB+oX__A0eNorzStKTUzOSEzKSQUAG3AEew/view

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 03:34:20 +00:00
..
2024-12-12 02:07:29 -08:00