Skip to main content

executeAsync

Summary

Execute a function with error boundary protection.

Signature

executeAsync<T>(operation: () => Promise<T>, context?: ErrorContext, fallback?: () => Promise<T>): Promise<ErrorResult<T>>;

Parameters

operation

Type:() => Promise<T> The function to execute

context

Type:ErrorContext Optional: Yes Context information for error reporting

fallback

Type:() => Promise<T> Optional: Yes Optional fallback function to try on error

Returns

Type:Promise<ErrorResult<T>> Execute a function with error boundary protection.