Skip to content

Panicking in cx.spawn task should not bring down the entire app #632

Open
@jkelleyrtp

Description

@jkelleyrtp

Specific Demand

In react, if you throw an exception, it'll get caught by the react machinery as an error at the nearest error boundary.

WASM does not have the ability to catch panics properly, but non-wasm targets do.

We should catch panics in tasks and suspense and bubble them to the nearest error boundary if possible.

This is pretty straightforward by simply wrapping the scheduler poll logic with a panic handler.

Implement Suggestion

This comes in two parts

  • Add panic handling to rust for wasm targets
  • Wrap the scheduler logic with a panic handler

Metadata

Metadata

Assignees

No one assigned

    Labels

    consistencyimprove cohesiveness of featurescorerelating to the core implementation of the virtualdomenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions