From 6ed4401609817e18a0ff781529e35b2a209ff0da Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Tue, 12 Feb 2019 14:48:53 +0100 Subject: [PATCH] Permit issue posting to have network failures --- src/tools/publish_toolstate.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/tools/publish_toolstate.py b/src/tools/publish_toolstate.py index 18d447bcdb684..6f3f409b8feb6 100755 --- a/src/tools/publish_toolstate.py +++ b/src/tools/publish_toolstate.py @@ -145,10 +145,18 @@ def update_latest( build_failed = True if build_failed: - issue( - tool, MAINTAINERS.get(tool), - relevant_pr_number, relevant_pr_user, pr_reviewer, - ) + try: + issue( + tool, MAINTAINERS.get(tool), + relevant_pr_number, relevant_pr_user, pr_reviewer, + ) + except IOError as (errno, strerror): + # network errors will simply end up not creating an issue, but that's better + # than failing the entire build job + print "I/O error({0}): {1}".format(errno, strerror) + except: + print "Unexpected error:", sys.exc_info()[0] + raise if changed: status['commit'] = current_commit