Added errorType to error output
This commit is contained in:
parent
62fe93e88e
commit
44a875eeec
|
@ -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()}")
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue