From afc87ebc00bcbc830eb343f53dd3bb507f504c63 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 15 Aug 2017 11:14:01 +0200 Subject: [PATCH] clarify index read failure Instead of erroring out with an exception, make --restore emit an error message indicating that something is wrong with the index. --- deltatar/deltatar.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/deltatar/deltatar.py b/deltatar/deltatar.py index 378310a..55a1905 100644 --- a/deltatar/deltatar.py +++ b/deltatar/deltatar.py @@ -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('.') -- 1.7.1