]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Document websocket error handling change (and StreamClosedError).
authorBen Darnell <ben@bendarnell.com>
Thu, 6 Jun 2013 01:57:03 +0000 (21:57 -0400)
committerBen Darnell <ben@bendarnell.com>
Thu, 6 Jun 2013 01:57:03 +0000 (21:57 -0400)
docs/iostream.rst
docs/releases/next.rst
tornado/iostream.py

index a2933a8f24b71396aac047784258ec6cb74eabe1..a5e3869e355ee85cc506b8022447294007094fcf 100644 (file)
@@ -43,3 +43,8 @@
 
    .. autoclass:: PipeIOStream
       :members:
+
+   Exceptions
+   ----------
+
+   .. autoexception:: StreamClosedError
index 05ea57d65bbcfed090d5c9c612b61a569e9f2c32..a8d384b91b2893e68037eb1ab5926b4dd2aee6ae 100644 (file)
@@ -229,6 +229,9 @@ Multiple modules
 `tornado.websocket`
 ~~~~~~~~~~~~~~~~~~~
 
+* `.WebSocketHandler` now catches `.StreamClosedError` and runs
+  `~.WebSocketHandler.on_close` immediately instead of logging a
+  stack trace.
 * New method `.WebSocketHandler.set_nodelay` can be used to set the
   ``TCP_NODELAY`` flag.
 
index 9f9a1e60d87921bbfcf58d2ed3c670e54cdf3bb0..079012c9e41e67ea9173ab4bbf4ea9d94bdbb737 100644 (file)
@@ -48,6 +48,12 @@ except ImportError:
 
 
 class StreamClosedError(IOError):
+    """Exception raised by `IOStream` methods when the stream is closed.
+
+    Note that the close callback is scheduled to run *after* other
+    callbacks on the stream (to allow for buffered data to be processed),
+    so you may see this error before you see the close callback.
+    """
     pass