[Pkg-bazaar-commits] ./bzr/unstable r318: - better error message for Ctrl-c
Martin Pool
mbp at sourcefrog.net
Fri Apr 10 07:43:49 UTC 2009
------------------------------------------------------------
revno: 318
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Mon 2005-05-02 14:35:02 +1000
message:
- better error message for Ctrl-c
modified:
NEWS
bzrlib/commands.py
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS 2005-05-02 04:32:56 +0000
+++ b/NEWS 2005-05-02 04:35:02 +0000
@@ -7,8 +7,8 @@
* New 'bzr ignore PATTERN' command.
- * Nicer error message for broken pipe and similar conditions that
- don't indicate an internal error.
+ * Nicer error message for broken pipe, interrupt and similar
+ conditions that don't indicate an internal error.
TESTING:
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py 2005-05-02 04:32:56 +0000
+++ b/bzrlib/commands.py 2005-05-02 04:35:02 +0000
@@ -1146,6 +1146,10 @@
if str(e):
msg += ': ' + str(e)
_report_exception(e, msg)
+ return 2
+ except KeyboardInterrupt, e:
+ _report_exception(e, 'interrupted', quiet=True)
+ return 2
except Exception, e:
quiet = False
if isinstance(e, IOError) and e.errno == errno.EPIPE:
@@ -1154,7 +1158,7 @@
else:
msg = str(e).rstrip('\n')
_report_exception(e, msg, quiet)
- return 1
+ return 2
finally:
bzrlib.trace.close_trace()
More information about the Pkg-bazaar-commits
mailing list