From: Fredrik Tolf Date: Sun, 5 Jan 2014 22:42:39 +0000 (+0100) Subject: python: Catch some previously uncaught errors in rplex handler. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=b0a7be65031e2b3a91bc26c69eea6e75900cb961;p=ashd.git python: Catch some previously uncaught errors in rplex handler. --- diff --git a/python3/ashd/serve.py b/python3/ashd/serve.py index 9aae12c..f116518 100644 --- a/python3/ashd/serve.py +++ b/python3/ashd/serve.py @@ -272,15 +272,22 @@ class resplex(handler): data = next(respiter) except StopIteration: rem = True - req.flushreq() + try: + req.flushreq() + except: + log.error("exception occurred when handling response data", exc_info=True) except: rem = True log.error("exception occurred when iterating response", exc_info=True) if not rem: if data: - req.flushreq() - req.writedata(data) - else: + try: + req.flushreq() + req.writedata(data) + except: + log.error("exception occurred when handling response data", exc_info=True) + rem = True + if rem: current[req] = None try: if hasattr(respiter, "close"):