From: Philipp Gesang Date: Thu, 2 Mar 2017 13:54:59 +0000 (+0100) Subject: include offending mode string in exception X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=4eebf2bb61114d35aa5f9a650a1ec7b2b062ca59;p=python-delta-tar include offending mode string in exception Be a little more informative about the cause considering this exception is passed on to the user as-is. --- diff --git a/deltatar/deltatar.py b/deltatar/deltatar.py index bbfe79a..6ad4561 100644 --- a/deltatar/deltatar.py +++ b/deltatar/deltatar.py @@ -183,7 +183,8 @@ class DeltaTar(object): ''' if mode not in self.__file_extensions_dict: - raise Exception('Unrecognized extension') + raise Exception('Unrecognized extension mode=[%s] requested for files' + % str(mode)) self.excluded_files = excluded_files self.included_files = included_files @@ -206,7 +207,8 @@ class DeltaTar(object): elif 'aes' in mode: index_mode = mode[1:] elif mode not in self.__index_extensions_dict: - raise Exception('Unrecognized extension') + raise Exception('Unrecognized extension mode=[%s] requested for index' + % str(mode)) self.index_mode = index_mode self.current_time = datetime.datetime.now() @@ -1445,7 +1447,7 @@ class RestoreHelper(object): def restore(self, itpath, l_no, callback=None): ''' - Restore the path from the appropiate backup. Receives the current path + Restore the path from the appropriate backup. Receives the current path from the first index iterator. itpath must be not null. callback is a custom function that gets called for every file. '''