fix: making the publish trace error check broader (#14931)
This commit is contained in:
@@ -14,12 +14,8 @@ from urllib.request import Request, urlopen
|
|||||||
|
|
||||||
|
|
||||||
def is_rate_limit_error(e):
|
def is_rate_limit_error(e):
|
||||||
"""Check if an exception is a rate limit error"""
|
"""Check if an exception is a GitHub permission/quota error that should not be retried"""
|
||||||
return (
|
return isinstance(e, HTTPError) and e.code in [403, 429]
|
||||||
isinstance(e, HTTPError)
|
|
||||||
and e.code in [403, 429]
|
|
||||||
and "rate limit exceeded" in getattr(e, "error_body", "").lower()
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def make_github_request(url, token, method="GET", data=None):
|
def make_github_request(url, token, method="GET", data=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user