Implemented catching exceptions that occur in listeners
This commit is contained in:
parent
85acd02c36
commit
d7ff2d77e3
|
@ -1029,8 +1029,12 @@ open class BankingPresenter(
|
||||||
protected open fun callBanksChangedListeners() {
|
protected open fun callBanksChangedListeners() {
|
||||||
val banks = ArrayList(this.allBanks)
|
val banks = ArrayList(this.allBanks)
|
||||||
|
|
||||||
ArrayList(banksChangedListeners).forEach {
|
ArrayList(banksChangedListeners).forEach { listener ->
|
||||||
it(banks)
|
try {
|
||||||
|
listener(banks)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
log.error(e) { "Could not call BanksChanged listener $listener" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1044,8 +1048,12 @@ open class BankingPresenter(
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun callRetrievedAccountTransactionsResponseListener(response: GetTransactionsResponse) {
|
protected open fun callRetrievedAccountTransactionsResponseListener(response: GetTransactionsResponse) {
|
||||||
ArrayList(retrievedAccountTransactionsResponseListeners).forEach {
|
ArrayList(retrievedAccountTransactionsResponseListeners).forEach { listener ->
|
||||||
it(response)
|
try {
|
||||||
|
listener(response)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
log.error(e) { "Could not call RetrievedAccountTransactionsResponse listener $listener" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1061,8 +1069,12 @@ open class BankingPresenter(
|
||||||
protected open fun callSelectedAccountsChangedListeners(selectedAccounts: List<TypedBankAccount>) {
|
protected open fun callSelectedAccountsChangedListeners(selectedAccounts: List<TypedBankAccount>) {
|
||||||
val accounts = ArrayList(selectedAccounts)
|
val accounts = ArrayList(selectedAccounts)
|
||||||
|
|
||||||
ArrayList(selectedAccountsChangedListeners).forEach {
|
ArrayList(selectedAccountsChangedListeners).forEach { listener ->
|
||||||
it(accounts)
|
try {
|
||||||
|
listener(accounts)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
log.error(e) { "Could not call SelectedAccountsChanged listener $listener" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue