From 7dcf2022e37451eae2a9fbdcd4bfdc67f3f0a440 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Fri, 30 Sep 2016 23:47:23 +0100 Subject: [PATCH] Update change to suppress reporting of Tornado exception error 1 to updated package (ref:hacks.txt). --- lib/tornado/http1connection.py | 5 +++-- lib/tornado/iostream.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/tornado/http1connection.py b/lib/tornado/http1connection.py index 7ee83161..055f1827 100644 --- a/lib/tornado/http1connection.py +++ b/lib/tornado/http1connection.py @@ -726,8 +726,9 @@ class HTTP1ServerConnection(object): # This exception was already logged. conn.close() return - except Exception: - gen_log.error("Uncaught exception", exc_info=True) + except Exception as e: + if 1 != e.errno: + gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: diff --git a/lib/tornado/iostream.py b/lib/tornado/iostream.py index bcf44414..e3e70f04 100644 --- a/lib/tornado/iostream.py +++ b/lib/tornado/iostream.py @@ -648,7 +648,8 @@ class BaseIOStream(object): except UnsatisfiableReadError: raise except Exception as e: - gen_log.warning("error on read: %s" % e) + if 1 != e.errno: + gen_log.warning("error on read: %s" % e) self.close(exc_info=True) return if pos is not None: