Skip to content

ManimWeb: surface scene runtime errors via the error traitlet (#291) - #292

Open
koaning wants to merge 1 commit into
mainfrom
issue-291
Open

ManimWeb: surface scene runtime errors via the error traitlet (#291)#292
koaning wants to merge 1 commit into
mainfrom
issue-291

Conversation

@koaning

@koaning koaning commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Fixes #291. A ManimWeb scene's runtime errors were invisible: the recommended player.sequence(async (scene) => {...}) entry point runs its callback detached from the promise render() awaits, so a throw inside the scene became an unhandled promise rejection seen only in the browser console — the widget rendered blank and widget.error stayed "". This adds a per-instance window unhandledrejection listener that routes those errors through the existing showError() surface, so scene bugs now render in the cell and are readable from Python. The listener is guarded by a disposed flag and removed on teardown, and the CHANGELOG gets an ## [Unreleased] entry. Known caveat (documented in a code comment): unhandledrejection is page-global, so with multiple live ManimWeb widgets a rejection from one may be reported by all — an accepted trade-off for the single-widget iteration use case.

🤖 Generated with Claude Code

The recommended player.sequence(async (scene) => {...}) entry point runs
its callback detached from the promise render() awaits, so a throw inside
the scene was an unhandled promise rejection visible only in the browser
console — the widget rendered blank and widget.error stayed "". Add a
window unhandledrejection listener that routes those into the existing
showError() surface (error box + traitlet), cleaned up on teardown.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

ManimWeb: scene runtime errors don't reach the error traitlet (invisible in notebook / to Python)

1 participant