emitAsyncErrorEvent
Emits an asynchronous error event.
When a collection window is open (see startCollectingUnhandledAsyncErrors) the error is collected as unhandled unless it is ignored — either because shouldIgnore is true or an startAsyncErrorIgnoreContext scope is active. A registered consumer handler deliberately does not exempt the error: in production it shows the user a Notice, which is not a test asserting that the error was expected. startAsyncErrorIgnoreContext is the single, explicit opt-out.
Import:
import { emitAsyncErrorEvent } from '@mnaoumov/typescript-lib/error';Signature:
function emitAsyncErrorEvent(asyncError: unknown, shouldIgnore: boolean): voidParameters:
| Parameter | Type | Description |
|---|---|---|
asyncError |
unknown | The error to emit as an asynchronous error event. |
shouldIgnore |
boolean | Whether to treat the error as expected and never collect it as unhandled, regardless of the active ignore context. Used to carry the schedule-time ignore decision of a deferred fire-and-forget rejection. |
Returns: void
Links to this page: