Skip to content

startCollectingUnhandledAsyncErrors

Opens a window in which async errors emitted while no consumer handler is registered are collected as unhandled (see emitAsyncErrorEvent), discarding anything collected by a previous window.

Intended for the test harness only: the per-test setup opens a window before each test and drains it after each test via stopCollectingUnhandledAsyncErrors. In production no window is open, so emitting an async error carries no bookkeeping overhead.

Import:

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

Signature:

function startCollectingUnhandledAsyncErrors(): void

Returns: void


Links to this page: