changeset 0305f3dabd52 in modules/stock_package_shipping_dpd:6.0
details:
https://hg.tryton.org/modules/stock_package_shipping_dpd?cmd=changeset&node=0305f3dabd52
description:
Test if zeep Fault has detail before using it
issue10993
review370361002
(grafted from 5d3d5689673ce0b5b93d3a13cbfe65b93b3227d7)
diffstat:
stock.py | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diffs (23 lines):
diff -r 985005e482e4 -r 0305f3dabd52 stock.py
--- a/stock.py Mon May 03 16:11:27 2021 +0200
+++ b/stock.py Mon Dec 06 23:40:19 2021 +0100
@@ -145,12 +145,13 @@
})
break
except Fault as e:
- tag = etree.QName(e.detail[0].tag)
- if tag.localname == 'authenticationFault':
- count += 1
- credential.update_token()
- else:
- raise
+ if e.detail:
+ tag = etree.QName(e.detail[0].tag)
+ if tag.localname == 'authenticationFault':
+ count += 1
+ credential.update_token()
+ continue
+ raise
else:
raise DPDError(
gettext('stock_package_shipping_dpd.msg_dpd_login_error',