From 5e59d0b4f6280a7c66b0c310c3fb6bc4fc2cbfe9 Mon Sep 17 00:00:00 2001 From: Alexei Pertsev Date: Thu, 3 May 2018 18:33:30 +0300 Subject: [PATCH] Use `log_exception` method in WebSocketProtocol instead of custom logging. It is usefull if we need to add some custom handlers for all unexpected exceptions for example. --- tornado/websocket.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tornado/websocket.py b/tornado/websocket.py index 0507a92c6..9a84188f3 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -21,6 +21,7 @@ from __future__ import absolute_import, division, print_function import base64 import hashlib import os +import sys import struct import tornado.escape import tornado.web @@ -512,8 +513,7 @@ class WebSocketProtocol(object): try: result = callback(*args, **kwargs) except Exception: - app_log.error("Uncaught exception in %s", - getattr(self.request, 'path', None), exc_info=True) + self.handler.log_exception(*sys.exc_info()) self._abort() else: if result is not None: -- 2.47.2