Added error handler for attempt to read eBook from iDevice

This commit is contained in:
GRiker 2012-07-02 05:23:23 -06:00
parent 69e51ce64d
commit f063395135

View File

@ -828,7 +828,15 @@ class ITUNES(DriverBase):
if DEBUG:
logger().info("ITUNES.get_file(): exporting '%s'" % path)
outfile.write(open(self.cached_books[path]['lib_book'].location().path).read())
try:
outfile.write(open(self.cached_books[path]['lib_book'].location().path).read())
except:
# Clean up
logger().info(" unable to extract books from iDevices")
logger().info(" deleting empty ", outfile.name)
outfile.close()
os.remove(outfile.name)
raise UserFeedback("Unable to extract books from iDevices", details=None, level=UserFeedback.WARN)
def open(self, connected_device, library_uuid):
'''