Skip to main content

executeSync

Summary

Execute a synchronous function with error boundary protection.

Signature

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

Parameters

operation

Type:() => T The function to execute

context

Type:ErrorContext Optional: Yes Context information for error reporting

fallback

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

Returns

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