From 9eba706bd3662b975aa6d84e5022431ce54aa38f Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 27 Jun 2008 11:17:27 +0000 Subject: [PATCH] print the backend error code --- osc/core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osc/core.py b/osc/core.py index fdbb7743..b38232a4 100755 --- a/osc/core.py +++ b/osc/core.py @@ -1704,8 +1704,9 @@ def edit_meta(metatype, try: f.sync() except urllib2.HTTPError, e: - print e - input = raw_input('Try again? (yY = Yes - nN = No): ') + if e.code >= 400 and e.headers.get('X-Opensuse-Errorcode'): + print >>sys.stderr, 'BuildService API error:', e.headers.get('X-Opensuse-Errorcode') + input = raw_input('Try again? ([y/N]): ') if input != 'y' and input != 'Y': break else: