~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-10-06 07:33:33 UTC
  • mto: (1185.13.3)
  • mto: This revision was merged to the branch mainline in revision 1418.
  • Revision ID: mbp@sourcefrog.net-20051006073333-cf160dfe8ef018fc
- improved display of some errors, including NotBranchError

Show diffs side-by-side

added added

removed removed

Lines of Context:
624
624
def run_bzr_catch_errors(argv):
625
625
    try:
626
626
        try:
627
 
            try:
628
 
                return run_bzr(argv)
629
 
            finally:
630
 
                # do this here inside the exception wrappers to catch EPIPE
631
 
                sys.stdout.flush()
632
 
        #wrap common errors as CommandErrors.
633
 
        except (NotBranchError,), e:
634
 
            raise BzrCommandError(str(e))
 
627
            return run_bzr(argv)
 
628
        finally:
 
629
            # do this here inside the exception wrappers to catch EPIPE
 
630
            sys.stdout.flush()
635
631
    except BzrCommandError, e:
636
632
        # command line syntax error, etc
637
633
        log_error(str(e))
653
649
            bzrlib.trace.note('broken pipe')
654
650
            return 2
655
651
        else:
 
652
            import pdb
 
653
            pdb.pm()
656
654
            bzrlib.trace.log_exception()
657
655
            return 2
658
656