Skip to content

Commit

Permalink
publish-toolstate: show more context on HTTP error
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Aug 23, 2020
1 parent 9d606d9 commit 2e6f2e8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tools/publish_toolstate.py
Expand Up @@ -275,7 +275,7 @@ def update_latest(
return message


if __name__ == '__main__':
def main():
repo = os.environ.get('TOOLSTATE_VALIDATE_MAINTAINERS_REPO')
if repo:
github_token = os.environ.get('TOOLSTATE_REPO_ACCESS_TOKEN')
Expand Down Expand Up @@ -342,3 +342,11 @@ def update_latest(
}
))
response.read()


if __name__ == '__main__':
try:
main()
except urllib2.HTTPError as e:
print("HTTPError: %s\n%s" % (e, e.read()))
raise

0 comments on commit 2e6f2e8

Please sign in to comment.