~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2006-06-04 22:04:20 UTC
  • mto: This revision was merged to the branch mainline in revision 1797.
  • Revision ID: mbp@sourcefrog.net-20060604220420-6bab3e2b6ebe013e
Cleanup more exception-formatting code

Show diffs side-by-side

added added

removed removed

Lines of Context:
654
654
    except Exception, e:
655
655
        # used to handle AssertionError and KeyboardInterrupt
656
656
        # specially here, but hopefully they're handled ok by the logger now
657
 
        import errno
658
 
        if (isinstance(e, IOError)
659
 
            and hasattr(e, 'errno')
660
 
            and e.errno == errno.EPIPE):
661
 
            bzrlib.trace.note('broken pipe')
662
 
            return 3
663
 
        else:
664
 
            bzrlib.trace.report_exception(sys.exc_info(), sys.stderr)
665
 
            if os.environ.get('BZR_PDB'):
666
 
                print '**** entering debugger'
667
 
                import pdb
668
 
                pdb.post_mortem(sys.exc_traceback)
669
 
            return 3
 
657
        bzrlib.trace.report_exception(sys.exc_info(), sys.stderr)
 
658
        if os.environ.get('BZR_PDB'):
 
659
            print '**** entering debugger'
 
660
            import pdb
 
661
            pdb.post_mortem(sys.exc_traceback)
 
662
        return 3
670
663
 
671
664
if __name__ == '__main__':
672
665
    sys.exit(main(sys.argv))