diff options
author | Lorenz Diener <[email protected]> | 2017-10-02 10:13:23 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2017-10-02 10:13:23 +0200 |
commit | b18b6f201b75f704655e0784930a74050fb196b9 (patch) | |
tree | 26e0c87c04990806835920bbdce2042b0b1e1b67 /mastodon | |
parent | 15fe471df386a0a29a45d4e79ee1e3c4851aaac2 (diff) | |
parent | c64617ee9474d8690df1e395f8454f02a0ddae6c (diff) | |
download | mastodon.py-b18b6f201b75f704655e0784930a74050fb196b9.tar.gz |
Merge pull request #89 from Elizafox/exception-hierarchy
Redesign exception hierarchy
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index e59bdb7..5b198a5 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -1263,21 +1263,29 @@ class Mastodon: | |||
1263 | ## | 1263 | ## |
1264 | # Exceptions | 1264 | # Exceptions |
1265 | ## | 1265 | ## |
1266 | class MastodonIllegalArgumentError(ValueError): | 1266 | class MastodonError(Exception): |
1267 | """Base class for Mastodon.py exceptions""" | ||
1268 | |||
1269 | |||
1270 | class MastodonIllegalArgumentError(ValueError, MastodonError): | ||
1267 | pass | 1271 | pass |
1268 | 1272 | ||
1269 | 1273 | ||
1270 | class MastodonFileNotFoundError(IOError): | 1274 | class MastodonIOError(IOError, MastodonError): |
1275 | """Base class for Mastodon.py I/O errors""" | ||
1276 | |||
1277 | |||
1278 | class MastodonFileNotFoundError(MastodonIOError): | ||
1271 | pass | 1279 | pass |
1272 | 1280 | ||
1273 | 1281 | ||
1274 | class MastodonNetworkError(IOError): | 1282 | class MastodonNetworkError(MastodonIOError): |
1275 | pass | 1283 | pass |
1276 | 1284 | ||
1277 | 1285 | ||
1278 | class MastodonAPIError(Exception): | 1286 | class MastodonAPIError(MastodonError): |
1279 | pass | 1287 | pass |
1280 | 1288 | ||
1281 | 1289 | ||
1282 | class MastodonRatelimitError(Exception): | 1290 | class MastodonRatelimitError(MastodonError): |
1283 | pass | 1291 | pass |