From 598edfdb32ef7156a0952ce8958cdd2abf0b1cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9lande=20Adrien?= Date: Mon, 9 Sep 2019 15:39:52 +0200 Subject: [PATCH] [ing] catch recipient error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this new error may be for people not allowed to add recipients, but the website message is not relevant: ``` L’ajout de bénéficiaire n’a pas pu être effectué. Pour plus d’information, veuillez contacter notre Centre de Relation Client. ``` Closes: 46321@sibi --- modules/ing/api_browser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ing/api_browser.py b/modules/ing/api_browser.py index 573381f298..4902311a80 100644 --- a/modules/ing/api_browser.py +++ b/modules/ing/api_browser.py @@ -433,7 +433,11 @@ def handle_recipient_error(self, r): # it is the only time that it appears if error['code'] == 'SENSITIVE_OPERATION.SENSITIVE_OPERATION_NOT_FOUND': raise AddRecipientTimeout() - elif error['code'] == 'EXTERNAL_ACCOUNT.EXTERNAL_ACCOUNT_ALREADY_EXISTS': + elif error['code'] in ( + 'EXTERNAL_ACCOUNT.EXTERNAL_ACCOUNT_ALREADY_EXISTS', + # not allowed to add a recipient + 'EXTERNAL_ACCOUNT.ACCOUNT_RESTRICTION', + ): raise AddRecipientBankError(message=error['message']) assert False, 'Recipient error not handled' -- GitLab