Skip to content

Access axios-retry configuration from the error object and fix its types #166

@jrmyio

Description

@jrmyio

I am trying to add some logging by using the retryCondition as proposed in #134 (comment).

In the message I want to log the current retryCount and the total retries.
For example: 'Re-trying {url} (1/3 tries)'.

However, I cannot access the 'retries' config variable (which is the total amount of retries) from the AxiosError object.

There seems to be a AxiosError.config['axios-retry'] in the error object that according to its types should match IAxiosRetry.IAxiosRetryConfig. Instead the AxiosError.config['axios-retry'] seems to contain a shape of
{ retryCount: number, lastRequestTime: number}.

It would be great if the { retryCount: number, lastRequestTime: number} is either merged with the existing IAxiosRetry.IAxiosRetryConfig, or use a different variable name instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions