Skip to content

Possible to get retryCount from afterResponse() or beforeError() hooks #511

@priithansen

Description

@priithansen

I would like to show a notification to users on 5xx errors but as it is now I can't figure out a way to avoid showing it for only the last retry.

The code could live in either afterResponse or beforeError hook and from there I can get the current retry config ex: error.options.retry.limit but as far as I can tell no way to know if the request in question is last retry in the series.

Thank You for this useful and to the point library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions