-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" | ||
Exceptions for the Siwar API wrapper. | ||
""" | ||
|
||
class SiwarAPIError(Exception): | ||
"""Base exception for Siwar API errors.""" | ||
|
||
def __init__(self, message: str): | ||
self.message = message | ||
super().__init__(self.message) | ||
|
||
|
||
class SiwarAuthError(SiwarAPIError): | ||
"""Raised when authentication with the API fails.""" | ||
pass | ||
|
||
|
||
class SiwarValueError(SiwarAPIError): | ||
"""Raised when invalid values are provided to API methods.""" | ||
pass | ||
|
||
|
||
class SiwarResponseError(SiwarAPIError): | ||
"""Raised when API response cannot be parsed.""" | ||
pass | ||
|
||
|
||
class SiwarTimeoutError(SiwarAPIError): | ||
"""Raised when API request times out.""" | ||
pass | ||
|
||
|
||
class SiwarRateLimitError(SiwarAPIError): | ||
"""Raised when API rate limit is exceeded.""" | ||
pass |