From edf5712fb3f5def93f51bd18727bbbdd348278f7 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 31 Jul 2015 16:45:46 +0200 Subject: [PATCH] [FIX] runbot: better handling of github API errors --- runbot/runbot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runbot/runbot.py b/runbot/runbot.py index e059f2a5..f9258ab5 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -244,6 +244,7 @@ class runbot_repo(osv.osv): response = session.post(url, data=simplejson.dumps(payload)) else: response = session.get(url) + response.raise_for_status() return response.json() except Exception: if ignore_errors: @@ -447,7 +448,7 @@ class runbot_branch(osv.osv): repo = branch.repo_id if repo.token and branch.name.startswith('refs/pull/'): pull_number = branch.name[len('refs/pull/'):] - return repo.github('/repos/:owner/:repo/pulls/%s' % pull_number) + return repo.github('/repos/:owner/:repo/pulls/%s' % pull_number, ignore_errors=True) or {} return {} class runbot_build(osv.osv):