]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Use `log_exception` method in WebSocketProtocol instead of 2374/head
authorAlexei Pertsev <oeermanz@gmail.com>
Thu, 3 May 2018 15:33:30 +0000 (18:33 +0300)
committerAlexei Pertsev <oeermanz@gmail.com>
Thu, 3 May 2018 15:46:49 +0000 (18:46 +0300)
custom logging. It is usefull if we need to add some custom
handlers for all unexpected exceptions for example.

tornado/websocket.py

index 0507a92c67ea82ec5900d0378ca9a89b0abab8c8..9a84188f3ac7e6d2963a5d6c4ea06953dbadba2e 100644 (file)
@@ -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: