Skip to main content
Module

x/xstate/src/reportUnhandledError.ts

Actor-based state management & orchestration for complex app logic.
Go to Latest
File
/** * This function makes sure that unhandled errors are thrown in a separate macrotask. * It allows those errors to be detected by global error handlers and reported to bug tracking services * without interrupting our own stack of execution. * * @param err error to be thrown */export function reportUnhandledError(err: unknown) { setTimeout(() => { throw err; });}