From dd5f4ae08af21e5965b3670231ac92c5503f58cc Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Tue, 17 Apr 2018 15:22:07 +0200 Subject: [PATCH] Document streaming error handling --- docs/index.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index f463156..4de0f6e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -725,7 +725,7 @@ Streaming --------- These functions allow access to the streaming API. -If `async` is False, these methods block forever (or until an exception is raised). +If `async` is False, these methods block forever (or until an error is encountered). If `async` is True, the listener will listen on another thread and these methods will return a handle corresponding to the open connection. If, in addition, `async_reconnect` is True, @@ -741,6 +741,10 @@ The streaming functions take instances of `StreamListener` as the `listener` par A `CallbackStreamListener` class that allows you to specify function callbacks directly is included for convenience. +When in not-async mode or async mode without async_reconnect, the stream functions may raise +various exceptions: `MastodonMalformedEventError` if a received event cannot be parsed and +`MastodonNetworkError` if any connection problems occur. + .. automethod:: Mastodon.stream_user .. automethod:: Mastodon.stream_public .. automethod:: Mastodon.stream_local