Got: Custom `retry.retries` function unexpectedly breaks `statusCode` and other conditional retries

Created on 14 Mar 2019  路  4Comments  路  Source: sindresorhus/got


Issuehunt badges

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

szmarczak szmarczak has been rewarded.

Backers (Total: $60.00)

- #830 Don't break the default behavior when using custom retry function

Tips

IssueHunt has been backed by the following sponsors. Become a sponsor


Rewarded on Issuehunt enhancement good for beginner

Most helpful comment

@issuehunt has funded $60.00 to this issue.


All 4 comments

And retries would not work with stream API which documentation should state it.

And retries would 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

  • :moneybag: Total deposit: $60.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $6.00
Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukechu10 picture lukechu10  路  3Comments

pvdlg picture pvdlg  路  3Comments

khizarsonu picture khizarsonu  路  3Comments

AxelTerizaki picture AxelTerizaki  路  3Comments

joolfe picture joolfe  路  3Comments