Commit 614533db authored by Jeremy Hylton's avatar Jeremy Hylton

Make doubly sure that SystemExit isn't caught be generic error handling.

parent 07affa72
...@@ -167,11 +167,14 @@ class Connection(smac.SizedMessageAsyncConnection): ...@@ -167,11 +167,14 @@ class Connection(smac.SizedMessageAsyncConnection):
meth = getattr(self.obj, name) meth = getattr(self.obj, name)
try: try:
ret = meth(*args) ret = meth(*args)
except (SystemExit, KeyboardInterrupt):
raise
except Exception, msg: except Exception, msg:
error = sys.exc_info()[:2] error = sys.exc_info()
log("%s() raised exception: %s" % (name, msg), log("%s() raised exception: %s" % (name, msg), zLOG.ERROR,
zLOG.ERROR, error=sys.exc_info()) error=error)
return self.return_error(msgid, flags, error[0], error[1]) error = error[:2]
return self.return_error(msgid, flags, *error)
if flags & ASYNC: if flags & ASYNC:
if ret is not None: if ret is not None:
...@@ -186,7 +189,9 @@ class Connection(smac.SizedMessageAsyncConnection): ...@@ -186,7 +189,9 @@ class Connection(smac.SizedMessageAsyncConnection):
self.send_reply(msgid, ret) self.send_reply(msgid, ret)
def handle_error(self): def handle_error(self):
self.log_error() if sys.exc_info()[0] == SystemExit:
raise sys.exc_info()
self.log_error("Error caught in asyncore")
self.close() self.close()
def log_error(self, msg="No error message supplied"): def log_error(self, msg="No error message supplied"):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment