changeset 5277daad526d in modules/stock_package_shipping_dpd:6.2
details:
https://hg.tryton.org/modules/stock_package_shipping_dpd?cmd=changeset&node=5277daad526d
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 47bde15f6923 -r 5277daad526d stock.py
--- a/stock.py Mon Nov 01 17:38:32 2021 +0100
+++ b/stock.py Mon Dec 06 23:40:19 2021 +0100
@@ -147,12 +147,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',