aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mastodon/Mastodon.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 98cebab..f55d4bb 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -2245,6 +2245,8 @@ class Mastodon:
2245 # on any 404 2245 # on any 404
2246 elif response_object.status_code == 401: 2246 elif response_object.status_code == 401:
2247 ex_type = MastodonUnauthorizedError 2247 ex_type = MastodonUnauthorizedError
2248 elif response_object.status_code == 502:
2249 ex_type = MastodonServerError
2248 else: 2250 else:
2249 ex_type = MastodonAPIError 2251 ex_type = MastodonAPIError
2250 2252
@@ -2539,6 +2541,10 @@ class MastodonAPIError(MastodonError):
2539 """Raised when the mastodon API generates a response that cannot be handled""" 2541 """Raised when the mastodon API generates a response that cannot be handled"""
2540 pass 2542 pass
2541 2543
2544class MastodonServerError(MastodonError):
2545 """Raised if the Server is malconfigured, e.g. returns a 502 error code"""
2546 pass
2547
2542class MastodonNotFoundError(MastodonAPIError): 2548class MastodonNotFoundError(MastodonAPIError):
2543 """Raised when the mastodon API returns a 404 Not Found error""" 2549 """Raised when the mastodon API returns a 404 Not Found error"""
2544 pass 2550 pass
Powered by cgit v1.2.3 (git 2.41.0)