diff options
-rw-r--r-- | mastodon/Mastodon.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index fc585ba..27c98af 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -2242,6 +2242,8 @@ class Mastodon: | |||
2242 | # on any 404 | 2242 | # on any 404 |
2243 | elif response_object.status_code == 401: | 2243 | elif response_object.status_code == 401: |
2244 | ex_type = MastodonUnauthorizedError | 2244 | ex_type = MastodonUnauthorizedError |
2245 | elif response_object.status_code == 502: | ||
2246 | ex_type = MastodonServerError | ||
2245 | else: | 2247 | else: |
2246 | ex_type = MastodonAPIError | 2248 | ex_type = MastodonAPIError |
2247 | 2249 | ||
@@ -2528,6 +2530,10 @@ class MastodonAPIError(MastodonError): | |||
2528 | """Raised when the mastodon API generates a response that cannot be handled""" | 2530 | """Raised when the mastodon API generates a response that cannot be handled""" |
2529 | pass | 2531 | pass |
2530 | 2532 | ||
2533 | class MastodonServerError(MastodonError): | ||
2534 | """Raised if the Server is malconfigured, e.g. returns a 502 error code""" | ||
2535 | pass | ||
2536 | |||
2531 | class MastodonNotFoundError(MastodonAPIError): | 2537 | class MastodonNotFoundError(MastodonAPIError): |
2532 | """Raised when the mastodon API returns a 404 Not Found error""" | 2538 | """Raised when the mastodon API returns a 404 Not Found error""" |
2533 | pass | 2539 | pass |