mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot: better handling of github API errors
This commit is contained in:
parent
491151d251
commit
edf5712fb3
@ -244,6 +244,7 @@ class runbot_repo(osv.osv):
|
|||||||
response = session.post(url, data=simplejson.dumps(payload))
|
response = session.post(url, data=simplejson.dumps(payload))
|
||||||
else:
|
else:
|
||||||
response = session.get(url)
|
response = session.get(url)
|
||||||
|
response.raise_for_status()
|
||||||
return response.json()
|
return response.json()
|
||||||
except Exception:
|
except Exception:
|
||||||
if ignore_errors:
|
if ignore_errors:
|
||||||
@ -447,7 +448,7 @@ class runbot_branch(osv.osv):
|
|||||||
repo = branch.repo_id
|
repo = branch.repo_id
|
||||||
if repo.token and branch.name.startswith('refs/pull/'):
|
if repo.token and branch.name.startswith('refs/pull/'):
|
||||||
pull_number = branch.name[len('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 {}
|
return {}
|
||||||
|
|
||||||
class runbot_build(osv.osv):
|
class runbot_build(osv.osv):
|
||||||
|
Loading…
Reference in New Issue
Block a user