From 8b9539656e16b95e385e1214026d57f66219753c Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Mon, 13 Feb 2023 20:55:34 +0100 Subject: [PATCH] ebics download - improved error handling --- account_ebics/wizards/ebics_xfer.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/account_ebics/wizards/ebics_xfer.py b/account_ebics/wizards/ebics_xfer.py index 12eb03c..3694a61 100644 --- a/account_ebics/wizards/ebics_xfer.py +++ b/account_ebics/wizards/ebics_xfer.py @@ -233,7 +233,7 @@ class EbicsXfer(models.TransientModel): self.note += _( "EBICS Functional Error during download of " "File Format %(name)s (%(order_type)s):", - name=df.name, + name=df.name or df.description, order_type=df.order_type, ) self.note += "\n" @@ -245,7 +245,7 @@ class EbicsXfer(models.TransientModel): self.note += _( "EBICS Technical Error during download of " "File Format %(name)s (%(order_type)s):", - name=df.name, + name=df.name or df.description, order_type=df.order_type, ) self.note += "\n" @@ -256,28 +256,29 @@ class EbicsXfer(models.TransientModel): self.note += _( "EBICS Verification Error during download of " "File Format %(name)s (%(order_type)s):", - name=df.name, + name=df.name or df.description, order_type=df.order_type, ) self.note += "\n" self.note += _("The EBICS response could not be verified.") except UserError as e: + err_cnt += 1 self.note += "\n" self.note += _( - "Warning during download of " + "Error detected during download of " "File Format %(name)s (%(order_type)s):", - name=df.name, + name=df.name or df.description, order_type=df.order_type, ) self.note += "\n" - self.note += e.name + self.note += " ".join(e.args) except Exception: err_cnt += 1 self.note += "\n" self.note += _( "Unknown Error during download of " "File Format %(name)s (%(order_type)s):", - name=df.name, + name=df.name or df.description, order_type=df.order_type, ) tb = "".join(format_exception(*exc_info()))