payme-pkg 3.0.11__tar.gz → 3.0.12b0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of payme-pkg might be problematic. Click here for more details.

Files changed (34) hide show
  1. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/PKG-INFO +1 -1
  2. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/exceptions/general.py +47 -5
  3. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme_pkg.egg-info/PKG-INFO +1 -1
  4. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/setup.py +1 -1
  5. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/LICENSE.txt +0 -0
  6. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/README.md +0 -0
  7. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/__init__.py +0 -0
  8. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/admin.py +0 -0
  9. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/apps.py +0 -0
  10. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/classes/__init__.py +0 -0
  11. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/classes/cards.py +0 -0
  12. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/classes/client.py +0 -0
  13. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/classes/http.py +0 -0
  14. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/classes/initializer.py +0 -0
  15. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/classes/receipts.py +0 -0
  16. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/const.py +0 -0
  17. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/exceptions/__init__.py +0 -0
  18. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/exceptions/webhook.py +0 -0
  19. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/migrations/__init__.py +0 -0
  20. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/models.py +0 -0
  21. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/types/__init__.py +0 -0
  22. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/types/request/__init__.py +0 -0
  23. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/types/response/__init__.py +0 -0
  24. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/types/response/cards.py +0 -0
  25. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/types/response/receipts.py +0 -0
  26. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/types/response/webhook.py +0 -0
  27. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/urls.py +0 -0
  28. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/util.py +0 -0
  29. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme/views.py +0 -0
  30. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme_pkg.egg-info/SOURCES.txt +0 -0
  31. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme_pkg.egg-info/dependency_links.txt +0 -0
  32. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme_pkg.egg-info/requires.txt +0 -0
  33. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/payme_pkg.egg-info/top_level.txt +0 -0
  34. {payme_pkg-3.0.11 → payme_pkg-3.0.12b0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: payme-pkg
3
- Version: 3.0.11
3
+ Version: 3.0.12b0
4
4
  Home-page: https://github.com/Muhammadali-Akbarov/payme-pkg
5
5
  Author: Muhammadali Akbarov
6
6
  Author-email: muhammadali17abc@gmail.com
@@ -2,16 +2,51 @@ import logging
2
2
 
3
3
 
4
4
  class BaseError(Exception):
5
- """Base class for all errors in the payment system."""
5
+ """
6
+ Base class for all errors in the payment system.
7
+
8
+ Attributes:
9
+ code (str or int): Error code identifying the type of error.
10
+ message (str): A human-readable error message.
11
+ data (dict, optional): Additional context or metadata for the error.
12
+ """
6
13
  logger = logging.getLogger(__name__)
7
14
 
8
- def __init__(self, code, message, data=None):
15
+ def __init__(self, code=None, message=None, data=None, *args, **kwargs):
16
+ """
17
+ Initialize the BaseError instance.
18
+
19
+ Args:
20
+ code (str or int, optional): Error code identifying the error type.
21
+ message (str, optional): Human-readable error description.
22
+ data (dict, optional): Additional context or metadata.
23
+ *args: Additional positional arguments for exception context.
24
+ **kwargs: Additional keyword arguments for exception context.
25
+ """
26
+ # Use default values if none provided
27
+ code = code or "UNKNOWN_ERROR"
28
+ message = message or "An unspecified error occurred."
29
+
9
30
  super().__init__(message)
31
+
10
32
  self.code = code
11
33
  self.data = data
34
+ self.args = args
35
+ self.kwargs = kwargs
12
36
 
13
- # pylint: disable=W1203
14
- self.logger.error(f"Error {code}: {message}. Data: {data}")
37
+ # Structured logging for better insights
38
+ self.logger.error(
39
+ f"[{self.__class__.__name__}] Code: {code}, Message: {message}, "
40
+ f"Data: {data}, Args: {args}, Kwargs: {kwargs}",
41
+ exc_info=True
42
+ )
43
+
44
+ def __repr__(self):
45
+ """Provide a developer-friendly string representation."""
46
+ return (
47
+ f"<{self.__class__.__name__} code={self.code!r} message={self.message!r} "
48
+ f"data={self.data!r}>"
49
+ )
15
50
 
16
51
 
17
52
  class CardError(BaseError):
@@ -237,6 +272,12 @@ class ReceiptsNotFoundError(BaseException):
237
272
  super().__init__(message, data)
238
273
 
239
274
 
275
+ class UnknownError(BaseException):
276
+ """An unknown error occurred."""
277
+ def __init__(self, message="An unknown error occurred.", data=None):
278
+ super().__init__(message, data)
279
+
280
+
240
281
  errors_map = {
241
282
  -32300: TransportError,
242
283
  -32700: ParseError,
@@ -255,5 +296,6 @@ errors_map = {
255
296
  -31102: OtpAttemptsExceededError,
256
297
  -31103: OtpInvalidCodeError,
257
298
  -31602: ReceiptsNotFoundError,
258
- -32500: InvalidTokenFormat
299
+ -32500: InvalidTokenFormat,
300
+ "UNKNOWN_ERROR": UnknownError
259
301
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: payme-pkg
3
- Version: 3.0.11
3
+ Version: 3.0.12b0
4
4
  Home-page: https://github.com/Muhammadali-Akbarov/payme-pkg
5
5
  Author: Muhammadali Akbarov
6
6
  Author-email: muhammadali17abc@gmail.com
@@ -7,7 +7,7 @@ long_description = (here / "README.md").read_text(encoding="utf-8")
7
7
 
8
8
  setup(
9
9
  name='payme-pkg',
10
- version='3.0.11',
10
+ version='3.0.12b',
11
11
  license='MIT',
12
12
  author="Muhammadali Akbarov",
13
13
  author_email='muhammadali17abc@gmail.com',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes