clarify index read failure
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Tue, 15 Aug 2017 09:14:01 +0000 (11:14 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 2 Apr 2018 11:34:09 +0000 (13:34 +0200)
Instead of erroring out with an exception, make --restore emit an
error message indicating that something is wrong with the index.

deltatar/deltatar.py

index 378310a..55a1905 100644 (file)
@@ -1393,8 +1393,13 @@ class DeltaTar(object):
                 index_it = self.iterate_index_path(index1)
             except tarfile.DecryptionError as exn:
                 self.logger.error("failed to decrypt file [%s]: %s; is this an "
-                                  "actual index file?"
-                                  % (str(exn), index1))
+                                  "actual encrypted index file?"
+                                  % (index1, str (exn)))
+                return [(index1, exn)]
+            except Exception as exn:
+                # compressed files
+                self.logger.error("failed to read file [%s]: %s; is this an "
+                                  "actual index file?" % (index1, str (exn)))
                 return [(index1, exn)]
 
         dir_it = self._recursive_walk_dir('.')