Skip to content

Support retry for API errors #6

@sagimann

Description

@sagimann

Description

According to Google API docs, response code 5xx means that we should retry the validation. It would be great to have optional retry settings for the module, so it automatically retries in such cases.

Steps to Reproduce

  1. try to validate using verifySub, for example
  2. simulate 502 Bad Gateway error in code
  3. observe that, currently, the clients do not have any information whether the error was retriable, and the module will not retry the request

Sample code

N/A

Expected behavior:

// I expect the following method would retry in case of retriable 5xx errors, see promise-retry npm for example settings:
verifySub(token, { retries: 5 })

Actual behavior:

no retry is currently supported

Versions

2.0.3

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