Type Alias WrapInTryOptions<FallbackValue>

WrapInTryOptions<FallbackValue>: PartialWithUndefined<{
    fallbackValue: FallbackValue;
    handleError: ((error: unknown) => FallbackValue);
}>

Options for wrapInTry.

Type Parameters

  • FallbackValue

Type declaration

  • fallbackValue: FallbackValue

    Fallback to this value if the callback passed to wrapInTry throws an error. This will be ignored if a handleError option is also set.

  • handleError: ((error: unknown) => FallbackValue)

    Call this function if the callback passed to wrapInTry throws an error. The thrown error is passed to this function. If a fallbackValue option is also provided, it will be ignored.