From 0ef77b8cd7760af485babdb44fb338c1ab83af56 Mon Sep 17 00:00:00 2001 From: lethliel Date: Tue, 21 Jul 2020 13:42:24 +0200 Subject: [PATCH] print detailed error message in interactive review Print the details of a Bad Request also in interactive review mode. --- osc/core.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osc/core.py b/osc/core.py index 9bd7b5b1..ee1cc16f 100644 --- a/osc/core.py +++ b/osc/core.py @@ -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