1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-26 12:12:11 +01:00

Merge branch 'detailed_error_int_review' of https://github.com/lethliel/osc

Be more verbose in case of an HTTPError in core.request_interactive_review.
This commit is contained in:
Marcus Huewe 2020-07-22 23:16:57 +02:00
commit 077138e5ad

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