mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot_merge: merge() can be non-json in some cases (???)
Rather than blow up with a json error and take down the cron, convert json decode error to a mergeerror in order to put the PR in error and try to dump however much data we can.
This commit is contained in:
parent
dd29e6b8a8
commit
16c492ef0a
@ -114,7 +114,10 @@ class GH(object):
|
||||
'head': sha,
|
||||
'commit_message': message,
|
||||
}, check={409: exceptions.MergeError})
|
||||
r = r.json()
|
||||
try:
|
||||
r = r.json()
|
||||
except Exception:
|
||||
raise exceptions.MergeError("Got non-JSON reponse from github: %s %s (%s)" % (r.status_code, r.reason, r.content.decode('iso-8859-1')))
|
||||
_logger.debug("merge(%s, %s, %s) -> %s", self._repo, dest, shorten(message), r['sha'])
|
||||
return dict(r['commit'], sha=r['sha'])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user