diff --git a/weboob/applications/boobank/boobank.py b/weboob/applications/boobank/boobank.py index cf265c4932f159a25624b3f9f0970b4aa66548fe..a16f7b424b639668f34ff03db555fc1aac264012 100644 --- a/weboob/applications/boobank/boobank.py +++ b/weboob/applications/boobank/boobank.py @@ -28,7 +28,7 @@ from weboob.browser.browsers import APIBrowser from weboob.browser.profiles import Weboob -from weboob.exceptions import BrowserHTTPError, CaptchaQuestion +from weboob.exceptions import BrowserHTTPError, CaptchaQuestion, DecoupledValidation from weboob.core.bcall import CallErrors from weboob.capabilities.base import empty, find_object from weboob.capabilities.bank import ( @@ -483,6 +483,17 @@ def bcall_error_handler(self, backend, error, backtrace): next(iter(self.do('add_recipient', error.recipient, **params))) except CallErrors as e: self.bcall_errors_handler(e) + elif isinstance(error, DecoupledValidation): + # XXX for now, assume we are in a add_recipient process. + print(error.message) + params = {'backends': backend, + 'resume': True + } + + try: + next(iter(self.do('add_recipient', error.resource, **params))) + except CallErrors as e: + self.bcall_errors_handler(e) elif isinstance(error, TransferInvalidAmount): print(u'Error(%s): %s' % (backend.name, to_unicode(error) or 'The transfer amount is invalid'), file=self.stderr) elif isinstance(error, TransferInvalidLabel):