Skip to main content

DefaultErrorHandling

Upgather SDK


Upgather SDK / DefaultErrorHandling

Class: DefaultErrorHandling

Defined in: lib/error/DefaultErrorHandling.ts:73

Provides a basic implementation of error handling with enhanced error information.

Remarks

This class implements the ErrorHandlingStrategy interface with a default approach to handling errors, including detailed error context and optional logging.

Implements

Constructors

new DefaultErrorHandling()

new DefaultErrorHandling(options): DefaultErrorHandling

Defined in: lib/error/DefaultErrorHandling.ts:82

Creates an instance of DefaultErrorHandling.

Parameters

options

DefaultErrorHandlingOptions = {}

Configuration options

Returns

DefaultErrorHandling

Methods

handleError()

handleError(response, attempt, originalError): ErrorHandlingResult

Defined in: lib/error/DefaultErrorHandling.ts:106

Handles the API error using a default strategy.

Parameters

response

ApiResponse

The API response containing error details.

attempt

number

The current attempt number.

originalError

Error

The original error that occurred.

Returns

ErrorHandlingResult

An ErrorHandlingResult indicating to abort with an enhanced error.

Implementation of

ErrorHandlingStrategy.handleError