Skip to main content

Function: withSyncErrorHandling()

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

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

Synchronous error handling wrapper for operations that don't return promises.

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 when an error occurs.

Remarksโ€‹

Provides consistent error handling and fallback behavior for synchronous operations.