From: Alexei Pertsev Date: Thu, 3 May 2018 15:33:30 +0000 (+0300) Subject: Use `log_exception` method in WebSocketProtocol instead of X-Git-Tag: v5.1.0b1~22^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e59d0b4f6280a7c66b0c310c3fb6bc4fc2cbfe9;p=thirdparty%2Ftornado.git 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. --- 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: