Document errors more

This commit is contained in:
Lorenz Diener 2018-06-04 15:00:25 +02:00
pare 620687a079
commit 4c7c0c41f4

Veure arxiu

@ -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