Skip to content

Commit 9c42029

Browse files
authored
Rollup merge of rust-lang#75844 - ehuss:publish-toolstate-httperror, r=Mark-Simulacrum
publish-toolstate: show more context on HTTP error The default display for HTTPError in Python does not include the request body. For GitHub API, the body includes more details about the error (like rate limiting). This could help diagnosing errors like this: rust-lang#75815 (comment)
2 parents bc3d076 + 2e6f2e8 commit 9c42029

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/tools/publish_toolstate.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def update_latest(
275275
return message
276276

277277

278-
if __name__ == '__main__':
278+
def main():
279279
repo = os.environ.get('TOOLSTATE_VALIDATE_MAINTAINERS_REPO')
280280
if repo:
281281
github_token = os.environ.get('TOOLSTATE_REPO_ACCESS_TOKEN')
@@ -342,3 +342,11 @@ def update_latest(
342342
}
343343
))
344344
response.read()
345+
346+
347+
if __name__ == '__main__':
348+
try:
349+
main()
350+
except urllib2.HTTPError as e:
351+
print("HTTPError: %s\n%s" % (e, e.read()))
352+
raise

0 commit comments

Comments
 (0)