include offending mode string in exception
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Thu, 2 Mar 2017 13:54:59 +0000 (14:54 +0100)
committerPhilipp Gesang <philipp.gesang@intra2net.com>
Thu, 2 Mar 2017 13:55:04 +0000 (14:55 +0100)
Be a little more informative about the cause considering this
exception is passed on to the user as-is.

deltatar/deltatar.py

index bbfe79a..6ad4561 100644 (file)
@@ -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.
         '''