diff --git a/figo/figo.py b/figo/figo.py index faabe35..f98be6b 100644 --- a/figo/figo.py +++ b/figo/figo.py @@ -530,7 +530,8 @@ def add_account_and_sync(self, country, credentials, bank_code=None, iban=None, error=task_state.error['name'], error_description=task_state.error['description'], code=task_state.error['code']) - raise FigoException("", task_state.message) + raise FigoException("", error_description=task_state.error['message'], + code=task_state.error['code']) return task_state def add_account_and_sync_with_new_pin(self, pin_exception, new_pin): diff --git a/tests/test_writing_methods.py b/tests/test_writing_methods.py index 443939c..146801a 100644 --- a/tests/test_writing_methods.py +++ b/tests/test_writing_methods.py @@ -103,8 +103,8 @@ def test_051_add_account_and_sync_wrong_and_correct_pin(figo_session): assert isinstance(task_state, TaskState) assert len(figo_session.accounts) == 3 except FigoException as figo_exception: - # BBB(Valentin): prevent demo account from complaining - it returns no code on error - if "Please use demo account credentials" not in figo_exception.error_description: + # XXXValentin): prevent demo account from complaining + if figo_exception.code != 90000: raise