Skip to main content

Function: withSyncErrorHandling()

withSyncErrorHandling<T>(operation: () => T, operationName: string, fallbackValue: T): T

Defined in: src/utils/fallbacks.ts:98

Synchronous error handling wrapper for operations that don't return promises. Provides consistent error handling and fallback behavior for sync operations.

Type Parametersโ€‹

Tโ€‹

T

Parametersโ€‹

operationโ€‹

() => T

Synchronous operation to execute

operationNameโ€‹

string

Name for logging purposes

fallbackValueโ€‹

T

Value to return if operation fails

Returnsโ€‹

T

Result of operation or fallback value