Added errorType to error output

This commit is contained in:
dankito 2024-09-17 17:26:35 +02:00
parent 62fe93e88e
commit 44a875eeec
2 changed files with 4 additions and 4 deletions

View File

@ -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()}")
}
```

View File

@ -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)