karrio-easyship 2025.5.1__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/easyship/error.py +22 -2
- {karrio_easyship-2025.5.1.dist-info → karrio_easyship-2025.5.3.dist-info}/METADATA +1 -1
- {karrio_easyship-2025.5.1.dist-info → karrio_easyship-2025.5.3.dist-info}/RECORD +6 -6
- {karrio_easyship-2025.5.1.dist-info → karrio_easyship-2025.5.3.dist-info}/WHEEL +0 -0
- {karrio_easyship-2025.5.1.dist-info → karrio_easyship-2025.5.3.dist-info}/entry_points.txt +0 -0
- {karrio_easyship-2025.5.1.dist-info → karrio_easyship-2025.5.3.dist-info}/top_level.txt +0 -0
|
@@ -12,9 +12,9 @@ def parse_error_response(
|
|
|
12
12
|
**kwargs,
|
|
13
13
|
) -> typing.List[models.Message]:
|
|
14
14
|
errors: list = [
|
|
15
|
-
*([response["error"]] if response.get("error") else []),
|
|
15
|
+
*([{**response["error"], "level": "error"}] if response.get("error") else []),
|
|
16
16
|
*[
|
|
17
|
-
dict(code="warning", message=message)
|
|
17
|
+
dict(code="warning", message=message, level="warning")
|
|
18
18
|
for message in response.get("meta", {}).get("errors", [])
|
|
19
19
|
],
|
|
20
20
|
]
|
|
@@ -25,6 +25,7 @@ def parse_error_response(
|
|
|
25
25
|
carrier_name=settings.carrier_name,
|
|
26
26
|
code=error.get("code"),
|
|
27
27
|
message=error.get("message"),
|
|
28
|
+
level=_get_level(error.get("type"), error.get("level")),
|
|
28
29
|
details=lib.to_dict(
|
|
29
30
|
{
|
|
30
31
|
**kwargs,
|
|
@@ -36,3 +37,22 @@ def parse_error_response(
|
|
|
36
37
|
)
|
|
37
38
|
for error in errors
|
|
38
39
|
]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _get_level(error_type: typing.Optional[str], default_level: str = "error") -> str:
|
|
43
|
+
"""Map Easyship error type to standardized level.
|
|
44
|
+
|
|
45
|
+
Easyship uses types like: invalid_request_error, api_error, etc.
|
|
46
|
+
"""
|
|
47
|
+
if error_type is None:
|
|
48
|
+
return default_level
|
|
49
|
+
|
|
50
|
+
error_type_lower = error_type.lower()
|
|
51
|
+
|
|
52
|
+
# Map common error types to levels
|
|
53
|
+
if "warning" in error_type_lower:
|
|
54
|
+
return "warning"
|
|
55
|
+
elif "info" in error_type_lower or "notice" in error_type_lower:
|
|
56
|
+
return "info"
|
|
57
|
+
|
|
58
|
+
return default_level
|
|
@@ -4,7 +4,7 @@ karrio/mappers/easyship/proxy.py,sha256=xoaDjuuEW9kWsBVxBKr42g_jNv2K9l4zB2bOAE2D
|
|
|
4
4
|
karrio/mappers/easyship/settings.py,sha256=ghyujn4gy5XtjCggAI59tzEAHNX_GxA0RC2-vxxv_mo,489
|
|
5
5
|
karrio/plugins/easyship/__init__.py,sha256=ENXQAYszRmxCvdVoY8EJtRAJBL0u31AlUhEmKD3Kpx0,543
|
|
6
6
|
karrio/providers/easyship/__init__.py,sha256=dWvRdjJLzka87iVfszU3cWVDJJBQn2YKKrT7-rZjAAU,759
|
|
7
|
-
karrio/providers/easyship/error.py,sha256=
|
|
7
|
+
karrio/providers/easyship/error.py,sha256=sqp_d9TMhjB1dg6UxJ-cIi8QW1UMV2pI_Xp623eJlz0,1711
|
|
8
8
|
karrio/providers/easyship/manifest.py,sha256=BoFk5beASPeIbdToB5yi_naVzUSTLcIB11rLBmgJ7kY,2243
|
|
9
9
|
karrio/providers/easyship/metadata.json,sha256=EuukQpPGZST6ANmXCz5QqTYYAhFUxHvt3QAnxlrqyvk,229126
|
|
10
10
|
karrio/providers/easyship/rate.py,sha256=PSKu8wDJH0i3xeUpk6OLmIe7Pyio6_i4tiXmP8ekqpk,9005
|
|
@@ -32,8 +32,8 @@ karrio/schemas/easyship/shipment_request.py,sha256=nowz5CWtxdZg4zb81a_QsrmEI0dEt
|
|
|
32
32
|
karrio/schemas/easyship/shipment_response.py,sha256=9uJJs4xR0bLLz7vmZMCSaIyz59dBl4kvHjMKwVvLs7g,11002
|
|
33
33
|
karrio/schemas/easyship/tracking_request.py,sha256=XQ735p0jyG46fzaNlSqb2Wu8Ral6UgID8HFM6fBQsPw,1620
|
|
34
34
|
karrio/schemas/easyship/tracking_response.py,sha256=QwuvI_8-YQXo-2q6uMAJA5IQrgX2gfoPtg1TGBHoZA4,1830
|
|
35
|
-
karrio_easyship-2025.5.
|
|
36
|
-
karrio_easyship-2025.5.
|
|
37
|
-
karrio_easyship-2025.5.
|
|
38
|
-
karrio_easyship-2025.5.
|
|
39
|
-
karrio_easyship-2025.5.
|
|
35
|
+
karrio_easyship-2025.5.3.dist-info/METADATA,sha256=H5W14HIXc3H0h7EZQU75_JaILPF3YE1yR18HwGn24X4,997
|
|
36
|
+
karrio_easyship-2025.5.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
37
|
+
karrio_easyship-2025.5.3.dist-info/entry_points.txt,sha256=fWVjIqvIorXvb1UVUMceu3i7pP0ba6gJnaZm7HLkZIY,61
|
|
38
|
+
karrio_easyship-2025.5.3.dist-info/top_level.txt,sha256=FZCY8Nwft8oEGHdl--xku8P3TrnOxu5dETEU_fWpRSM,20
|
|
39
|
+
karrio_easyship-2025.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|