Skip to content

Commit

Permalink
Add errors docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
LulzLoL231 committed Jan 11, 2023
1 parent 907dbcf commit 24a351e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyCryptoPay-SDK"
version = "1.7.0"
version = "1.7.1"
description = "Python API wrapper for CryptoPay API"
authors = ["Maxim Mosin <max@mosin.pw>"]
license = "MIT"
Expand Down Expand Up @@ -49,7 +49,7 @@ requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.bumpver]
current_version = "1.7.0"
current_version = "1.7.1"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "Bump version {old_version} -> {new_version}"
commit = true
Expand Down
2 changes: 1 addition & 1 deletion src/CryptoPayAPI/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .api import CryptoPay


__version__ = '1.7.0'
__version__ = '1.7.1'
__doc__ = 'CryptoPay API client'
__author__ = 'Maxim Mosin (@LulzLoL231) <max@mosin.pw>'
18 changes: 18 additions & 0 deletions src/CryptoPayAPI/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@


class BaseError(Exception):
'''Base error class
Attributes:
raw_response (dict, optional): RAW response from CryptoPay API.
raw_headers (dict, optional): RAW headers from CryptoPay API response.
'''
def __init__(self,
*args: object,
raw_response: Optional[dict] = None,
Expand All @@ -17,24 +23,36 @@ def __init__(self,


class UnauthorizedError(BaseError):
'''Authorization on CryptoPay API is failed, maybe incorect/expired API token.
'''
pass


class MethodNotFoundError(BaseError):
'''Requested method is not found.
'''
pass


class UnexpectedError(BaseError):
'''Unexpected API error.
'''
pass


class ExpiresInInvalidError(BaseError):
'''Value of `expires_in` is invalid.
'''
pass


class UpdateSignatureError(BaseError):
'''Webhook signature validation error.
'''
pass


class MethodDisabledError(BaseError):
'''Requested method is disabled. Check bot settings.
'''
pass

0 comments on commit 24a351e

Please sign in to comment.