mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot_merge: error logging on 422 responses from GH
This commit is contained in:
parent
c687e9ae8b
commit
5ebb53cdc7
@ -1,6 +1,6 @@
|
||||
import collections
|
||||
import functools
|
||||
import itertools
|
||||
import json as json_
|
||||
import logging
|
||||
|
||||
import requests
|
||||
@ -30,6 +30,15 @@ class GH(object):
|
||||
exc = check.get(r.status_code)
|
||||
if exc:
|
||||
raise exc(r.content)
|
||||
if r.status_code == 422:
|
||||
# dump & format body if it's a 422 as GH's HTTP Reason is
|
||||
# completely useless (only states
|
||||
# "Unprocessable Entity for URL: <endpoint>" which is not
|
||||
# exactly great for debugging what went wrong
|
||||
raise requests.HTTPError(
|
||||
json_.dumps(r.json(), indent=4),
|
||||
response=r
|
||||
)
|
||||
r.raise_for_status()
|
||||
return r
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user