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

More meaningful error if ET.parse runs into problems. Fixes #153.

This commit is contained in:
Arun Persaud 2015-05-24 10:57:03 -07:00
parent 56a9ab60dc
commit ac93a3934e

View File

@ -750,7 +750,13 @@ class Project:
packages_file = os.path.join(self.absdir, store, '_packages')
if os.path.isfile(packages_file) and os.path.getsize(packages_file):
return ET.parse(packages_file)
try:
result = ET.parse(packages_file)
except:
msg = 'Cannot read package file \'%s\'. ' % packages_file
msg += 'You can try to remove it and then run osc repairwc.'
raise oscerr.OscIOError(None, msg)
return result
else:
# scan project for existing packages and migrate them
cur_pacs = []