Skip to content

invokeAsyncSafely

Invokes a Promise and safely handles any errors by catching them and emitting an async error event.

Import:

import { invokeAsyncSafely } from 'obsidian-dev-utils/async';

Signature:

function invokeAsyncSafely(asyncFn: () => unknown, stackTrace: string | undefined): void

Parameters:

ParameterTypeDescription
asyncFn() => unknownThe asynchronous function to invoke safely.
stackTracestring | undefinedThe stack trace of the source function.

Returns: void


Links to this page: