From cfcd7624f77beccb5847bd687fd8ae92d7b13a1a Mon Sep 17 00:00:00 2001 From: Jason <52063018+dfjxs@users.noreply.github.com> Date: Fri, 7 Jan 2022 17:52:59 +1100 Subject: [PATCH] Catch exception when parsing filesystem (#29) * Catch exception when parsing filesystem --- dfdewey/utils/image_processor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dfdewey/utils/image_processor.py b/dfdewey/utils/image_processor.py index 2702d38..21f2149 100644 --- a/dfdewey/utils/image_processor.py +++ b/dfdewey/utils/image_processor.py @@ -178,9 +178,12 @@ class FileEntryScanner(volume_scanner.VolumeScanner): 'files (inum, filename, part)', self._rows) self._rows = [] - for sub_file_entry in file_entry.sub_file_entries: - self._list_file_entry( - file_system, sub_file_entry, path_segments, location) + try: + for sub_file_entry in file_entry.sub_file_entries: + self._list_file_entry( + file_system, sub_file_entry, path_segments, location) + except (OSError, dfvfs_errors.AccessError, dfvfs_errors.BackEndError) as e: + log.warning('Unable to list file entries: {0!s}'.format(e)) def get_volume_extents(self, image_path): """Gets the extents of all volumes.