diff --git a/README.md b/README.md index 66b6aa3b..fed56530 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ val options = GetAccountDataOptions( val response = client.getAccountData(options) ``` -### TAN handling +#### TAN handling Retrieving transactions older than 90 days or sometimes even log in requires a TAN, so add TAN handling in Client Callback: @@ -125,13 +125,13 @@ val client = FinTs4kBankingClientForUser(bankCode, loginName, password, SimpleBa }) ``` -### Error handling +#### Error handling Add some error handling by checking `response.error`: ```kotlin response.error?.let{ error -> - println("Could not fetch account data: ${error.internalError ?: error.errorMessagesFromBank.joinToString()}") + println("Could not fetch account data: ${error.type} ${error.internalError ?: error.errorMessagesFromBank.joinToString()}") } ``` diff --git a/SampleApp/src/main/kotlin/net/codinux/banking/client/fints4k/example/ShowUsage.kt b/SampleApp/src/main/kotlin/net/codinux/banking/client/fints4k/example/ShowUsage.kt index b3d96f5c..a589e06a 100644 --- a/SampleApp/src/main/kotlin/net/codinux/banking/client/fints4k/example/ShowUsage.kt +++ b/SampleApp/src/main/kotlin/net/codinux/banking/client/fints4k/example/ShowUsage.kt @@ -64,7 +64,7 @@ class ShowUsage { val response = client.getAccountData(options) response.error?.let{ error -> - println("Could not fetch account data: ${error.internalError ?: error.errorMessagesFromBank.joinToString()}") + println("Could not fetch account data: ${error.type} ${error.internalError ?: error.errorMessagesFromBank.joinToString()}") } printReceivedData(response)