diff --git a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/error.py b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/error.py index 62b4624bef..0916c75cea 100644 --- a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/error.py +++ b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/error.py @@ -17,8 +17,14 @@ def parse_error_response( errors.append( [ "400", - response.data["result"].get("statusError") - or response.data["result"].get("errors"), + ( + ( + response.data["result"].get("statusError") + or response.data["result"].get("errors") + ) + if isinstance(response.data["result"], dict) + else response.data["result"] + ), ] ) diff --git a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/cancel.py b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/cancel.py index db54d4766e..b9ca67ef97 100644 --- a/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/cancel.py +++ b/modules/connectors/allied_express_local/karrio/providers/allied_express_local/shipment/cancel.py @@ -14,7 +14,7 @@ def parse_shipment_cancel_response( ) -> typing.Tuple[models.ConfirmationDetails, typing.List[models.Message]]: response = _response.deserialize() messages = error.parse_error_response(response, settings) - success = not response.is_error and (response.data.get("result")) == "0" + success = not response.is_error # and (response.data.get("result")) == "0" confirmation = ( models.ConfirmationDetails(