SONY driver: Nicer error message when SONY XML db is corrupted

This commit is contained in:
Kovid Goyal 2010-09-10 12:38:59 -06:00
parent e7bf395f0b
commit 661b72e017

View File

@ -89,6 +89,10 @@ class XMLCache(object):
raw, strip_encoding_pats=True, assume_utf8=True,
verbose=DEBUG)[0],
parser=parser)
if self.roots[source_id] is None:
raise Exception(('The SONY database at %s is corrupted. Try '
' disconnecting and reconnecting your reader.')%path)
# }}}
recs = self.roots[0].xpath('//*[local-name()="records"]')