Skip to content

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, an startAsyncErrorIgnoreContext scope is active, or a consumer handler is registered.

Import:

import { emitAsyncErrorEvent } from 'obsidian-dev-utils/error';

Signature:

function emitAsyncErrorEvent(asyncError: unknown, shouldIgnore: boolean): void

Parameters:

ParameterTypeDescription
asyncErrorunknownThe error to emit as an asynchronous error event.
shouldIgnorebooleanWhether 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: