New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The type on BeforeRetryHook shouldn't contain any optional parameters #1420
Comments
Sorry I have an oversight on the documentation. It's now clear to me that The implementation can be found below. The hook is passed with only the options but not any error and retry count got/source/as-promise/index.ts Lines 107 to 110 in 1f132e8
|
|
Yeah, but I think we could at least add retry count in that case. |
Actually it's correct. It should be missing since it's not classic retrying. But I'm not sure whether we should call |
My 2cents, but maybe it'll make the usage clearer by separating this special case to another hook in the next version? e.g. |
/cc @sindresorhus |
I agree the current situation could be improved, but I'm not sold on a |
Fixed in #1667 |
Describe the bug
In the typescript definition of
BeforeRetryHook
,error
andretryCount
are declared as optional, meaning they're potentiallyundefined
. However, it's not true.got/source/core/index.ts
Line 107 in 0d43f5f
Actual behavior
error
andretryCount
contains theundefined
typeExpected behavior
error
andretryCount
should be just simplyRequestError
andnumber
The text was updated successfully, but these errors were encountered: