Skip to main content

DefaultErrorHandling

Upgather SDK


Upgather SDK / DefaultErrorHandling

Class: DefaultErrorHandling

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

Creates an instance of DefaultErrorHandling.

Parameters​

options​

DefaultErrorHandlingOptions = {}

Configuration options

Returns​

DefaultErrorHandling

Methods​

handleError()​

handleError(response, attempt, originalError): ErrorHandlingResult

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