mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
Make error handling in attribute_branch_pkg more robust
This commit is contained in:
parent
3e2bb0ec1d
commit
8bb903f41c
@ -5085,9 +5085,11 @@ def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute,
|
|||||||
try:
|
try:
|
||||||
f = http_POST(u)
|
f = http_POST(u)
|
||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
msg = ''.join(e.readlines())
|
root = ET.fromstring(e.read())
|
||||||
msg = msg.split('<summary>')[1]
|
summary = root.find('summary')
|
||||||
msg = msg.split('</summary>')[0]
|
if summary is not None and summary.text is not None:
|
||||||
|
raise oscerr.APIError(summary.text)
|
||||||
|
msg = 'unexpected response: %s' % ET.tostring(root, encoding=ET_ENCODING)
|
||||||
raise oscerr.APIError(msg)
|
raise oscerr.APIError(msg)
|
||||||
|
|
||||||
r = None
|
r = None
|
||||||
|
Loading…
Reference in New Issue
Block a user