diff options
author | Rob Austein <sra@hactrn.net> | 2012-03-19 21:14:48 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2012-03-19 21:14:48 +0000 |
commit | 8e3eb0fc2b371e1eb0f93afad97ff6cd53e7d78b (patch) | |
tree | fb5df7edce1c65230beb4770de2d0561d7387cd8 /rtr-origin/rtr-origin.py | |
parent | 4950a77da61c9993788c0557ef362ecdc0a1cf18 (diff) | |
parent | d559bc6a29311fa1c414ce8cc3632f5f74ee8485 (diff) |
Sync from trunk.
svn path=/branches/tk161/; revision=4403
Diffstat (limited to 'rtr-origin/rtr-origin.py')
-rwxr-xr-x | rtr-origin/rtr-origin.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/rtr-origin/rtr-origin.py b/rtr-origin/rtr-origin.py index 3b6ec145..9064e77a 100755 --- a/rtr-origin/rtr-origin.py +++ b/rtr-origin/rtr-origin.py @@ -1060,11 +1060,12 @@ class pdu_channel(asynchat.async_chat): """ Handle errors caught by asyncore main loop. """ - if backtrace_on_exceptions: + c, e = sys.exc_info()[:2] + if backtrace_on_exceptions or e == 0: for line in traceback.format_exc().splitlines(): log(line) else: - log("[Exception: %s]" % sys.exc_info()[1]) + log("[Exception: %s: %s]" % (c.__name__, e) log("[Exiting after unhandled exception]") sys.exit(1) @@ -1356,11 +1357,12 @@ class kickme_channel(asyncore.dispatcher): """ Handle errors caught by asyncore main loop. """ - if backtrace_on_exceptions: + c, e = sys.exc_info()[:2] + if backtrace_on_exceptions or e == 0: for line in traceback.format_exc().splitlines(): log(line) else: - log("[Exception: %s]" % sys.exc_info()[1]) + log("[Exception: %s: %s]" % (c.__name__, e) log("[Exiting after unhandled exception]") sys.exit(1) |