From b0a7be65031e2b3a91bc26c69eea6e75900cb961 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sun, 5 Jan 2014 23:42:39 +0100 Subject: [PATCH] python: Catch some previously uncaught errors in rplex handler. --- python3/ashd/serve.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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"): -- 2.11.0