b24api 0.7.2__tar.gz → 0.7.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: b24api
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary: Bitrix24 API
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -57,6 +57,10 @@ class BaseBitrix24(ABC):
57
57
  def _retry() -> type[Retrying | AsyncRetrying]:
58
58
  pass
59
59
 
60
+ @property
61
+ def host(self) -> str:
62
+ return self.settings.webhook_url.host
63
+
60
64
  def _validate_call_response(self, request: Request, response: httpx.Response) -> Response:
61
65
  # Checking more informative errors first (content may exist with 5xx status)
62
66
  with contextlib.suppress(httpx.ResponseNotRead, ValidationError):
@@ -61,9 +61,14 @@ class ErrorResponse(BaseModel):
61
61
 
62
62
  def raise_error(self, request: Request, settings: Settings) -> None:
63
63
  logger = logging.getLogger(settings.logger_name)
64
- logger.debug("Request: %s", request)
65
64
 
66
- error_cls = RetryApiResponseError if self.error in settings.retry_errors else ApiResponseError
65
+ if self.error in settings.retry_errors:
66
+ logger.debug("Request: %s", request)
67
+ error_cls = RetryApiResponseError
68
+ else:
69
+ logger.warning("Request: %s", request)
70
+ error_cls = ApiResponseError
71
+
67
72
  raise error_cls(
68
73
  code=self.error,
69
74
  description=self.error_description,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: b24api
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary: Bitrix24 API
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
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
File without changes
File without changes