From 4c7c0c41f4e21dcec9d12810a1b217959e8863b7 Mon Sep 17 00:00:00 2001 From: Lorenz Diener Date: Mon, 4 Jun 2018 15:00:25 +0200 Subject: [PATCH] Document errors more --- docs/index.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 4bcc70d..32d928f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -148,17 +148,26 @@ not exist). `MastodonFileNotFoundError` and `MastodonNetworkError` are IO errors - could be you specified a wrong URL, could be the internet is down or your hard drive is -dying. They inherit from MastodonIOError, for easy catching. +dying. They inherit from `MastodonIOError`, for easy catching. There is a sub-error +of `MastodonNetworkError`, `MastodonReadTimeout`, which is thrown when a streaming +API stream times out during reading. `MastodonAPIError` is an error returned from the Mastodon instance - the server has decided it can't fullfill your request (i.e. you requested info on a user that -does not exist). +does not exist). It is further split into `MastodonNotFoundError` (API returned 404) +and `MastodonUnauthorizedError` (API returned 401). Different error codes might exist, +but are not currently handled separately. + +`MastodonMalformedEventError` is raised when a streaming API listener receives an +invalid event. There have been reports that this can sometimes happen after prolonged +operation due to an upstream problem in the requests/urllib libraries. `MastodonRatelimitError` is raised when you hit an API rate limit. You should try again after a while (see the rate limiting section above). `MastodonVersionError` is raised when a version check for an API call fails. + Return values ------------- Unless otherwise specified, all data is returned as python dictionaries, matching