This commit is contained in:
Kovid Goyal 2012-08-09 11:21:36 +05:30
parent a19f8999cc
commit 64a2cbc4e0

View File

@ -190,15 +190,19 @@ class MTP_DEVICE(MTPDeviceBase):
if len(storage) > 2: if len(storage) > 2:
self._cardb_id = storage[2]['id'] self._cardb_id = storage[2]['id']
files, errs = self.dev.get_filelist(self) try:
if errs and not files: files, errs = self.dev.get_filelist(self)
raise OpenFailed('Failed to read files from device. Underlying errors:\n' if errs and not files:
+self.format_errorstack(errs)) raise OpenFailed('Failed to read files from device. Underlying errors:\n'
folders, errs = self.dev.get_folderlist() +self.format_errorstack(errs))
if errs and not folders: folders, errs = self.dev.get_folderlist()
raise OpenFailed('Failed to read folders from device. Underlying errors:\n' if errs and not folders:
+self.format_errorstack(errs)) raise OpenFailed('Failed to read folders from device. Underlying errors:\n'
self.filesystem_cache = FilesystemCache(files, folders) +self.format_errorstack(errs))
self.filesystem_cache = FilesystemCache(files, folders)
except:
self.dev = self._main_id = self._carda_id = self._cardb_id = None
raise
@synchronous @synchronous
def get_device_information(self, end_session=True): def get_device_information(self, end_session=True):