Document errors more
This commit is contained in:
pare
620687a079
commit
4c7c0c41f4
S'han modificat 1 arxius amb 11 adicions i 2 eliminacions
|
@ -148,17 +148,26 @@ not exist).
|
||||||
|
|
||||||
`MastodonFileNotFoundError` and `MastodonNetworkError` are IO errors - could be you
|
`MastodonFileNotFoundError` and `MastodonNetworkError` are IO errors - could be you
|
||||||
specified a wrong URL, could be the internet is down or your hard drive is
|
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
|
`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
|
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
|
`MastodonRatelimitError` is raised when you hit an API rate limit. You should try
|
||||||
again after a while (see the rate limiting section above).
|
again after a while (see the rate limiting section above).
|
||||||
|
|
||||||
`MastodonVersionError` is raised when a version check for an API call fails.
|
`MastodonVersionError` is raised when a version check for an API call fails.
|
||||||
|
|
||||||
|
|
||||||
Return values
|
Return values
|
||||||
-------------
|
-------------
|
||||||
Unless otherwise specified, all data is returned as python dictionaries, matching
|
Unless otherwise specified, all data is returned as python dictionaries, matching
|
||||||
|
|
Loading…
Referencia en una nova incidència