Skip to content

Commit

Permalink
Merge pull request #155 from arunpersaud/ET.parse_error
Browse files Browse the repository at this point in the history
More meaningful error if ET.parse runs into problems. Fixes #153.
  • Loading branch information
adrianschroeter committed Aug 13, 2015
2 parents f788fdd + ac93a39 commit 7352a47
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,13 @@ def read_packages(self):

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 = []
Expand Down

0 comments on commit 7352a47

Please sign in to comment.