~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-05-05 06:14:53 UTC
  • Revision ID: mbp@sourcefrog.net-20050505061453-21bd538616b8e5fc
- pychecker fixups

Show diffs side-by-side

added added

removed removed

Lines of Context:
869
869
        cmdobj = cmd_class(cmdopts, cmdargs).status 
870
870
 
871
871
 
872
 
def _report_exception(e, summary, quiet=False):
 
872
def _report_exception(summary, quiet=False):
873
873
    import traceback
874
874
    log_error('bzr: ' + summary)
875
 
    bzrlib.trace.log_exception(e)
 
875
    bzrlib.trace.log_exception()
876
876
 
877
877
    if not quiet:
878
878
        tb = sys.exc_info()[2]
897
897
                sys.stdout.flush()
898
898
        except BzrError, e:
899
899
            quiet = isinstance(e, (BzrCommandError))
900
 
            _report_exception(e, 'error: ' + e.args[0], quiet=quiet)
 
900
            _report_exception('error: ' + e.args[0], quiet=quiet)
901
901
            if len(e.args) > 1:
902
902
                for h in e.args[1]:
903
903
                    # some explanation or hints
907
907
            msg = 'assertion failed'
908
908
            if str(e):
909
909
                msg += ': ' + str(e)
910
 
            _report_exception(e, msg)
 
910
            _report_exception(msg)
911
911
            return 2
912
912
        except KeyboardInterrupt, e:
913
 
            _report_exception(e, 'interrupted', quiet=True)
 
913
            _report_exception('interrupted', quiet=True)
914
914
            return 2
915
915
        except Exception, e:
916
916
            quiet = False
919
919
                msg = 'broken pipe'
920
920
            else:
921
921
                msg = str(e).rstrip('\n')
922
 
            _report_exception(e, msg, quiet)
 
922
            _report_exception(msg, quiet)
923
923
            return 2
924
924
    finally:
925
925
        bzrlib.trace.close_trace()