karrio-eshipper 2025.5.2__py3-none-any.whl → 2025.5.3__py3-none-any.whl
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.
- karrio/providers/eshipper/error.py +20 -3
- {karrio_eshipper-2025.5.2.dist-info → karrio_eshipper-2025.5.3.dist-info}/METADATA +1 -1
- {karrio_eshipper-2025.5.2.dist-info → karrio_eshipper-2025.5.3.dist-info}/RECORD +6 -6
- {karrio_eshipper-2025.5.2.dist-info → karrio_eshipper-2025.5.3.dist-info}/WHEEL +0 -0
- {karrio_eshipper-2025.5.2.dist-info → karrio_eshipper-2025.5.3.dist-info}/entry_points.txt +0 -0
- {karrio_eshipper-2025.5.2.dist-info → karrio_eshipper-2025.5.3.dist-info}/top_level.txt +0 -0
|
@@ -11,10 +11,10 @@ def parse_error_response(
|
|
|
11
11
|
) -> typing.List[models.Message]:
|
|
12
12
|
responses = response if isinstance(response, list) else [response]
|
|
13
13
|
errors = [
|
|
14
|
-
*[_ for _ in responses if _.get("code")],
|
|
14
|
+
*[{**_, "level": _get_level(_)} for _ in responses if _.get("code")],
|
|
15
15
|
*sum(
|
|
16
16
|
[
|
|
17
|
-
[dict(code="warning", message=__) for __ in _.get("warnings")]
|
|
17
|
+
[dict(code="warning", message=__, level="warning") for __ in _.get("warnings")]
|
|
18
18
|
for _ in responses
|
|
19
19
|
if _.get("warnings")
|
|
20
20
|
],
|
|
@@ -25,7 +25,8 @@ def parse_error_response(
|
|
|
25
25
|
[
|
|
26
26
|
dict(
|
|
27
27
|
code="error",
|
|
28
|
-
message=order["message"]
|
|
28
|
+
message=order["message"],
|
|
29
|
+
level="error",
|
|
29
30
|
)
|
|
30
31
|
for order in _.get("order", [])
|
|
31
32
|
if "message" in order and order["message"].startswith("Error")
|
|
@@ -42,6 +43,7 @@ def parse_error_response(
|
|
|
42
43
|
carrier_name=settings.carrier_name,
|
|
43
44
|
code=error.get("code"),
|
|
44
45
|
message=error.get("message"),
|
|
46
|
+
level=error.get("level"),
|
|
45
47
|
details={
|
|
46
48
|
**kwargs,
|
|
47
49
|
"type": error.get("type"),
|
|
@@ -51,3 +53,18 @@ def parse_error_response(
|
|
|
51
53
|
)
|
|
52
54
|
for error in errors
|
|
53
55
|
]
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _get_level(error: dict) -> str:
|
|
59
|
+
"""Determine level from eshipper error response.
|
|
60
|
+
|
|
61
|
+
Uses the 'title' field if available (e.g., "Warn"), otherwise defaults to "error".
|
|
62
|
+
"""
|
|
63
|
+
title = error.get("title", "").lower()
|
|
64
|
+
|
|
65
|
+
if title == "warn" or title == "warning":
|
|
66
|
+
return "warning"
|
|
67
|
+
elif title == "info" or title == "notice":
|
|
68
|
+
return "info"
|
|
69
|
+
|
|
70
|
+
return "error"
|
|
@@ -4,7 +4,7 @@ karrio/mappers/eshipper/proxy.py,sha256=ZLOXHxgGPSVkitCqHJRFeRWpqjcFY01xVEuL2yz4
|
|
|
4
4
|
karrio/mappers/eshipper/settings.py,sha256=ZN7DTMBMTC_JtOgUFQ2UNCyU5j-VUfv2us_F90fL1jw,491
|
|
5
5
|
karrio/plugins/eshipper/__init__.py,sha256=v5cNriCwL5R2QR5x6Iki23CcBGPmGmH8zEL5j02u9Ko,448
|
|
6
6
|
karrio/providers/eshipper/__init__.py,sha256=Y9vKPYScbmFvM17L-x52m_yLLiG6WsX9j6o4NIERBMU,400
|
|
7
|
-
karrio/providers/eshipper/error.py,sha256=
|
|
7
|
+
karrio/providers/eshipper/error.py,sha256=uroZ2dW7OHEIrhi3HKnsd8EntmXaLpZisSDyJ2HLKOY,2038
|
|
8
8
|
karrio/providers/eshipper/metadata.json,sha256=KBae69ntmCIkZ0dKrAX0vjkm1CyE9UwvIstt7mLrq4M,369526
|
|
9
9
|
karrio/providers/eshipper/rate.py,sha256=0IbYJGPy3ff92KvKhaJhDHrPUjti4BYrCdMz_at7pGo,7210
|
|
10
10
|
karrio/providers/eshipper/tracking.py,sha256=46DVFj8iMLWSsi0f5irTzFpH0uArZtya4eyYh5LkdFQ,2452
|
|
@@ -26,8 +26,8 @@ karrio/schemas/eshipper/shipping_request.py,sha256=OrqSutwyzTj-iau3LDPJUEGBRzzV9
|
|
|
26
26
|
karrio/schemas/eshipper/shipping_response.py,sha256=RdMXh9goyTrH2qdU_5KMDIAWAEDzMchy_e5f45k-zxs,3892
|
|
27
27
|
karrio/schemas/eshipper/tracking_request.py,sha256=EAE7PJFp2rTYCXMQJ6Kg-hMs3vL-GSTFjhHvzSmMzPg,252
|
|
28
28
|
karrio/schemas/eshipper/tracking_response.py,sha256=2m9doy3y5f6zdA-gbNfsw8rp0oqs3eYrgw8Por_1fjE,2219
|
|
29
|
-
karrio_eshipper-2025.5.
|
|
30
|
-
karrio_eshipper-2025.5.
|
|
31
|
-
karrio_eshipper-2025.5.
|
|
32
|
-
karrio_eshipper-2025.5.
|
|
33
|
-
karrio_eshipper-2025.5.
|
|
29
|
+
karrio_eshipper-2025.5.3.dist-info/METADATA,sha256=gr9Xlf0MjDNcHE5Q1Pr3N8w2TqbktpbvlJH1BXfFc3M,997
|
|
30
|
+
karrio_eshipper-2025.5.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
31
|
+
karrio_eshipper-2025.5.3.dist-info/entry_points.txt,sha256=u9RQVmPE2uC3-aL85DnlIHdsHAWYkOnwTAfJvi2--DY,61
|
|
32
|
+
karrio_eshipper-2025.5.3.dist-info/top_level.txt,sha256=FZCY8Nwft8oEGHdl--xku8P3TrnOxu5dETEU_fWpRSM,20
|
|
33
|
+
karrio_eshipper-2025.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|