Skip to content

Is there any way to access retryCount on the BeforeRequestHook? #1866

@coleabbeduto-NM

Description

@coleabbeduto-NM

What would you like to discuss?

Currently we use the different hooks to log on different events like beforeRetry and afterResponse. But we've come to a point where we would like to add a beforeRequest hook with a logging statement in there. The problem comes in with that if you have two retries on a request, you get a beforeRequest log with every retry along with a beforeRetry log. So you get log spam.

We would like to try to avoid this by looking at the retryCount so that we don't log anything if this is a retry request, but it doesn't seem to be accessible in this hook unlike most of the others. Is there something that I'm missing or will this need to be a feature request?
...

Checklist

  • I have read the documentation.

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