diff --git a/modules/bnporc/pp/browser.py b/modules/bnporc/pp/browser.py index 7157d5f09af80c5da12c1d8a3290efb086cec5cc..ce45c485ede8ca8bd2a59d6e1d491c7ceb415b77 100644 --- a/modules/bnporc/pp/browser.py +++ b/modules/bnporc/pp/browser.py @@ -21,9 +21,10 @@ from __future__ import unicode_literals +import time from datetime import datetime + from dateutil.relativedelta import relativedelta -import time from requests.exceptions import ConnectionError from weboob.browser.browsers import LoginBrowser, URL, need_login, StatesMixin @@ -257,9 +258,10 @@ def iter_accounts(self): params = self.natio_vie_pro.go().get_params() try: # When the space does not exist we land on a 302 that tries to redirect - # to an unexisting domain, hence the 'allow_redirects=False' + # to an unexisting domain, hence the 'allow_redirects=False'. + # Sometimes the Life Insurance space is unavailable, hence the 'ConnectionError'. self.location(self.capitalisation_page.build(params=params), allow_redirects=False) - except ServerError: + except (ServerError, ConnectionError): self.logger.warning("An Internal Server Error occurred") else: if self.capitalisation_page.is_here() and self.page.has_contracts():