- command.func(parser, options, args)
- except (IOError, ParsingError, NoSectionError, CmdException,
- StackException, GitException, GitMergeException), err:
- print >> sys.stderr, '%s %s: %s' % (prog, cmd, err)
- sys.exit(2)
+ ret = command.func(parser, options, args)
+ except (StgException, IOError, ParsingError, NoSectionError), err:
+ directory.write_log(cmd)
+ out.error(str(err), title = '%s %s' % (prog, cmd))
+ if debug_level > 0:
+ traceback.print_exc()
+ sys.exit(utils.STGIT_COMMAND_ERROR)
+ except SystemExit:
+ # Triggered by the option parser when it finds bad commandline
+ # parameters.
+ sys.exit(utils.STGIT_COMMAND_ERROR)