fix github_error() for when API does not return ratelimit #413
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
A Github (Enterprise) instance does not always have rate-limiting activated and the corresponding API therefore does not return a
x-ratelimit-reset
, see #396.This fixes
github_error()
for when this is the case.Without this fix, the error message for the query in #396 is:
Now it is:
(The package is unknown, because
github_error()
is triggered bygithub_DESCRIPTION()
.)I guess one could also add some
guidance
for 401 errors? Let me know if you want me too.I also wondered whether the ratelimit information is indeed useful for non-429 HTTP errors? What do I do with that information, when it isn't causing the problem? If that info can be omitted, that could make the code cleaner, namely these three or four cases:
Please let me know what you think.