diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/AddAccountResponse.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/AddAccountResponse.kt index e85cee80..e88aafe8 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/AddAccountResponse.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/AddAccountResponse.kt @@ -13,9 +13,10 @@ open class AddAccountResponse( val supportsRetrievingTransactionsOfLast90DaysWithoutTan: Boolean = false, bookedTransactionsOfLast90Days: Map> = mapOf(), unbookedTransactionsOfLast90Days: Map> = mapOf(), - balances: Map = mapOf() + balances: Map = mapOf(), + error: Exception? = null ) - : GetTransactionsResponse(isSuccessful, errorToShowToUser, bookedTransactionsOfLast90Days, unbookedTransactionsOfLast90Days, balances) { + : GetTransactionsResponse(isSuccessful, errorToShowToUser, bookedTransactionsOfLast90Days, unbookedTransactionsOfLast90Days, balances, error) { override fun toString(): String { return account.toString() + " " + super.toString() diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/BankingClientResponse.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/BankingClientResponse.kt index 956c884b..abcde0b6 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/BankingClientResponse.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/BankingClientResponse.kt @@ -3,7 +3,8 @@ package net.dankito.banking.ui.model.responses open class BankingClientResponse( val isSuccessful: Boolean, - val errorToShowToUser: String? + val errorToShowToUser: String?, + val error: Exception? = null ) { diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/GetTransactionsResponse.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/GetTransactionsResponse.kt index 0fef818b..1a266c75 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/GetTransactionsResponse.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/model/responses/GetTransactionsResponse.kt @@ -10,6 +10,7 @@ open class GetTransactionsResponse( errorToShowToUser: String?, val bookedTransactions: Map> = mapOf(), val unbookedTransactions: Map> = mapOf(), - val balances: Map = mapOf() + val balances: Map = mapOf(), + error: Exception? = null ) - : BankingClientResponse(isSuccessful, errorToShowToUser) + : BankingClientResponse(isSuccessful, errorToShowToUser, error) diff --git a/fints4javaBankingClient/src/main/kotlin/net/dankito/banking/mapper/fints4javaModelMapper.kt b/fints4javaBankingClient/src/main/kotlin/net/dankito/banking/mapper/fints4javaModelMapper.kt index f26e1277..86706d2f 100644 --- a/fints4javaBankingClient/src/main/kotlin/net/dankito/banking/mapper/fints4javaModelMapper.kt +++ b/fints4javaBankingClient/src/main/kotlin/net/dankito/banking/mapper/fints4javaModelMapper.kt @@ -18,7 +18,7 @@ open class fints4javaModelMapper { open fun mapResponse(response: FinTsClientResponse): BankingClientResponse { - return BankingClientResponse(response.isSuccessful, mapErrorToShowToUser(response)) + return BankingClientResponse(response.isSuccessful, mapErrorToShowToUser(response), response.exception) } open fun mapResponse(account: Account, response: net.dankito.fints.response.client.AddAccountResponse): AddAccountResponse { @@ -34,7 +34,8 @@ open class fints4javaModelMapper { account, response.supportsRetrievingTransactionsOfLast90DaysWithoutTan, bookedTransactions, mapOf(), // TODO: map unbooked transactions - balances) + balances, + response.exception) } open fun mapResponse(bankAccount: BankAccount, response: net.dankito.fints.response.client.GetTransactionsResponse): GetTransactionsResponse { @@ -42,7 +43,8 @@ open class fints4javaModelMapper { return GetTransactionsResponse(response.isSuccessful, mapErrorToShowToUser(response), mapOf(bankAccount to mapTransactions(bankAccount, response.bookedTransactions)), mapOf(), // TODO: map unbooked transactions - response.balance?.let { mapOf(bankAccount to it) } ?: mapOf()) + response.balance?.let { mapOf(bankAccount to it) } ?: mapOf(), + response.exception) } open fun mapErrorToShowToUser(response: FinTsClientResponse): String? {