[@types/async-retry] has wrong type definition for onRetry #69565
Unanswered
yatki
asked this question in
Issues with a @types package
Replies: 1 comment
-
Thanks for the discussion about "async-retry", some useful links for everyone: Pinging the DT module owners: @albertywu, @MeLlamoPablo, @rafsawicki, @BendingBender. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey onRetry type signature currently defined as:
(property) AsyncRetry.Options.onRetry?: (e: Error, attempt: number) => any
.However, in practice
e
object is what RetryFunction returns. If a fetch call returns a 404 response, response object is provided to onRetry function.For instance if we stub the
discoveryRequest
method as below:error
object is theResponse
object that is returned from thediscoveryRequest
method.Expected behaviour:
e: ReturnType<typeof fn> | Error
Beta Was this translation helpful? Give feedback.
All reactions