1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-14 17:46:17 +01:00

print detailed error message in interactive review

Print the details of a Bad Request also in interactive review mode.
This commit is contained in:
lethliel 2020-07-21 13:42:24 +02:00
parent 55d3f46ac0
commit 0ef77b8cd7

View File

@ -7385,6 +7385,13 @@ def request_interactive_review(apiurl, request, initial_cmd='', group=None,
return True
except HTTPError as e:
print('Server returned an error:', e, file=sys.stderr)
details = e.hdrs.get('X-Opensuse-Errorcode')
if details:
print(details, file=sys.stderr)
root = ET.fromstring(e.read())
summary = root.find('summary')
if summary is not None:
print(summary.text, file=sys.stderr)
print('Try -f to force the state change', file=sys.stderr)
return False