Skip to content

Commit

Permalink
fix raising generic exception on task
Browse files Browse the repository at this point in the history
  • Loading branch information
fricklerhandwerk committed May 30, 2017
1 parent d80c806 commit 9c3a99c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion figo/figo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_writing_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 9c3a99c

Please sign in to comment.