1942
1938
def main(argv):
1944
1939
bzrlib.trace.open_tracefile(argv)
1949
return run_bzr(argv[1:])
1951
# do this here inside the exception wrappers to catch EPIPE
1954
quiet = isinstance(e, (BzrCommandError))
1955
_report_exception('error: ' + str(e), quiet=quiet)
1958
# some explanation or hints
1961
except AssertionError, e:
1962
msg = 'assertion failed'
1964
msg += ': ' + str(e)
1965
_report_exception(msg)
1967
except KeyboardInterrupt, e:
1968
_report_exception('interrupted', quiet=True)
1970
except Exception, e:
1973
if (isinstance(e, IOError)
1974
and hasattr(e, 'errno')
1975
and e.errno == errno.EPIPE):
1979
msg = str(e).rstrip('\n')
1980
_report_exception(msg, quiet)
1983
bzrlib.trace.close_trace()
1943
return run_bzr(argv[1:])
1945
# do this here inside the exception wrappers to catch EPIPE
1947
except BzrCommandError, e:
1948
# command line syntax error, etc
1952
bzrlib.trace.log_exception()
1954
except AssertionError, e:
1955
bzrlib.trace.log_exception('assertion failed: ' + str(e))
1957
except KeyboardInterrupt, e:
1958
bzrlib.trace.note('interrupted')
1960
except Exception, e:
1962
if (isinstance(e, IOError)
1963
and hasattr(e, 'errno')
1964
and e.errno == errno.EPIPE):
1965
bzrlib.trace.note('broken pipe')
1968
bzrlib.trace.log_exception('terminated by exception')
1986
1972
if __name__ == '__main__':