From 044b068e32f1cac9d7c6e23a2dec7a8a3d0b6703 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 22 Nov 2024 11:21:27 +0100 Subject: [PATCH] [UPD] delivery_deliverea: Update error message displayed --- .../models/deliverea_request.py | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/delivery_deliverea/models/deliverea_request.py b/delivery_deliverea/models/deliverea_request.py index aa303c41cd..7a505a63b3 100644 --- a/delivery_deliverea/models/deliverea_request.py +++ b/delivery_deliverea/models/deliverea_request.py @@ -73,28 +73,11 @@ def _check_error(self, res): if isinstance(error, list): error = error[0] return_code = error.get("code") - message = error.get("message") - detail = error.get("detail", "") if return_code: raise UserError( - _("%(name)s: %(rcode)s %(message)s %(detail)s %(ccode)s") - % { - "name": _("Deliverea Error"), - "rcode": return_code, - "message": message, - "detail": " ".join( - ["%s: %s" % (key, value) for key, value in detail.items()] - ) - if detail and not isinstance(detail, str) - else detail or "", - "ccode": "\n{}: {} {}".format( - _("Carrier Error"), - error.get("carrierCode"), - error.get("carrierMessage"), - ) - if error.get("carrierCode") - else "", - } + error.get("carrierMessage") + if error.get("carrierMessage") + else "Uncontrolled error, it is necessary to check the log" ) else: raise UserError(