Skip to content

Commit 2e6f2e8

Browse files
committed
publish-toolstate: show more context on HTTP error
1 parent 9d606d9 commit 2e6f2e8

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)