diff options
-rw-r--r-- | mastodon/Mastodon.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 65ce518..bfc2a9b 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -2750,7 +2750,8 @@ class Mastodon: | |||
2750 | # on any 404 | 2750 | # on any 404 |
2751 | elif response_object.status_code == 401: | 2751 | elif response_object.status_code == 401: |
2752 | ex_type = MastodonUnauthorizedError | 2752 | ex_type = MastodonUnauthorizedError |
2753 | elif response_object.status_code == 502: | 2753 | elif response_object.status_code >= 500 and \ |
2754 | response_object.status_code <= 511: | ||
2754 | ex_type = MastodonServerError | 2755 | ex_type = MastodonServerError |
2755 | else: | 2756 | else: |
2756 | ex_type = MastodonAPIError | 2757 | ex_type = MastodonAPIError |
@@ -3068,7 +3069,7 @@ class MastodonAPIError(MastodonError): | |||
3068 | pass | 3069 | pass |
3069 | 3070 | ||
3070 | class MastodonServerError(MastodonError): | 3071 | class MastodonServerError(MastodonError): |
3071 | """Raised if the Server is malconfigured, e.g. returns a 502 error code""" | 3072 | """Raised if the Server is malconfigured and returns a 5xx error code""" |
3072 | pass | 3073 | pass |
3073 | 3074 | ||
3074 | class MastodonNotFoundError(MastodonAPIError): | 3075 | class MastodonNotFoundError(MastodonAPIError): |