novaposhta-python-client 0.1.8__tar.gz → 0.1.9__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.
Files changed (18) hide show
  1. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/PKG-INFO +1 -1
  2. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/client.py +8 -3
  3. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/pyproject.toml +1 -1
  4. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/LICENSE.md +0 -0
  5. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/README.md +0 -0
  6. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/__init__.py +0 -0
  7. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/models/__init__.py +0 -0
  8. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/models/additional_service.py +0 -0
  9. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/models/address.py +0 -0
  10. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/models/base.py +0 -0
  11. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/models/common.py +0 -0
  12. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/models/contact_person.py +0 -0
  13. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/models/counterparty.py +0 -0
  14. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/models/internet_document.py +0 -0
  15. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/models/scan_sheet.py +0 -0
  16. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/models/tracking_document.py +0 -0
  17. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/mypi.ini +0 -0
  18. {novaposhta_python_client-0.1.8 → novaposhta_python_client-0.1.9}/novaposhta/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: novaposhta-python-client
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: Python client for Nova Poshta API
5
5
  Home-page: https://github.com/semolex/novaposhta-python-client
6
6
  License: MIT
@@ -153,9 +153,14 @@ class NovaPoshtaApi:
153
153
 
154
154
  if response["success"]:
155
155
  return response
156
-
157
- error = response["errors"][0]
158
- if error.startswith("API key"):
156
+ errors = response["errors"]
157
+ error = ""
158
+ if isinstance(errors, list):
159
+ error = ", ".join(errors)
160
+ elif isinstance(errors, dict):
161
+ error = ", ".join([f"{k}: {v}" for k, v in errors.items()])
162
+
163
+ if "API key" in error:
159
164
  raise InvalidAPIKeyError(error)
160
165
  else:
161
166
  raise APIRequestError(error)
@@ -3,7 +3,7 @@ name = "novaposhta-python-client"
3
3
  packages = [
4
4
  { include = "novaposhta"}
5
5
  ]
6
- version = "0.1.8"
6
+ version = "0.1.9"
7
7
  description = "Python client for Nova Poshta API"
8
8
  authors = ["Oleksii <semolex@live.com>"]
9
9
  license = "MIT"