Since retry.statusCodes and retry.errorCodes option support is implemented as part of the default retries function, those options are incompatible with custom retry function. Moreover even default statusCodes become not working so you get retries for HTTP 401, for example.
This is not quite obvious and documentation says nothing about that.
I think this is a bug to be fixed or at least it should be stated in readme.
IssueHunt Summary
IssueHunt has been backed by the following sponsors. Become a sponsor
And retries would not work with stream API which documentation should state it.
And
retrieswould not work with stream API which documentation should state it.
Oh man! I just spent hours trying to figure out why this wasn't working!
Should definitely be documented.
@issuehunt has funded $60.00 to this issue.
@sindresorhus has rewarded $54.00 to @szmarczak. See it on IssueHunt
Most helpful comment
@issuehunt has funded $60.00 to this issue.