chiark / gitweb /
Make a common superclass for all StGit exceptions
[stgit] / stgit / main.py
index 2c8716b2d850c070597c1b4ca987a299c7b69330..f54330d3e4f6dc12fa7cd2e1173f73b892884192 100644 (file)
@@ -255,13 +255,10 @@ def main():
 
     # These modules are only used from this point onwards and do not
     # need to be imported earlier
+    from stgit.exception import StgException
     from stgit.config import config_setup
     from ConfigParser import ParsingError, NoSectionError
-    from stgit.stack import Series, StackException
-    from stgit.git import GitException
-    from stgit.commands.common import CmdException
-    from stgit.gitmergeonefile import GitMergeException
-    from stgit.utils import EditorException
+    from stgit.stack import Series
 
     try:
         debug_level = int(os.environ['STGIT_DEBUG_LEVEL'])
@@ -284,9 +281,7 @@ def main():
             stgit.commands.common.crt_series = command.crt_series
 
         command.func(parser, options, args)
-    except (IOError, ParsingError, NoSectionError, CmdException,
-            StackException, GitException, GitMergeException,
-            EditorException), err:
+    except (StgException, IOError, ParsingError, NoSectionError), err:
         print >> sys.stderr, '%s %s: %s' % (prog, cmd, err)
         if debug_level > 0:
             raise