diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt index 0351148f..8c9f4eac 100644 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt +++ b/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt @@ -61,7 +61,7 @@ open class FinTsClient( val dialogEndRequestBody = messageBuilder.createAnonymousDialogEndMessage(bank, dialogData) - getResponseForMessage(dialogEndRequestBody, bank) + getAndHandleResponseForMessage(dialogEndRequestBody, bank) } @@ -185,14 +185,14 @@ open class FinTsClient( val dialogEndRequestBody = messageBuilder.createDialogEndMessage(bank, customer, dialogData) - getResponseForMessage(dialogEndRequestBody, bank) + getAndHandleResponseForMessage(dialogEndRequestBody, bank) } protected open fun getAndHandleResponseForMessage(requestBody: String, bank: BankData): Response { val webResponse = getResponseForMessage(requestBody, bank) - return handleResponse(webResponse) + return handleResponse(webResponse, bank) } protected open fun getResponseForMessage(requestBody: String, bank: BankData): WebClientResponse { @@ -205,7 +205,7 @@ open class FinTsClient( ) } - protected open fun handleResponse(webResponse: WebClientResponse): Response { + protected open fun handleResponse(webResponse: WebClientResponse, bank: BankData): Response { val responseBody = webResponse.body if (webResponse.isSuccessful && responseBody != null) { @@ -216,6 +216,9 @@ open class FinTsClient( return responseParser.parse(decodedResponse) } + else { + log.error("Request to $bank (${bank.finTs3ServerAddress}) failed", webResponse.error) + } return Response(false, exception = webResponse.error) } diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/model/BankData.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/model/BankData.kt index f2304576..ca1f319f 100644 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/model/BankData.kt +++ b/fints4javaLib/src/main/kotlin/net/dankito/fints/model/BankData.kt @@ -25,7 +25,7 @@ open class BankData( override fun toString(): String { - return bankCode + return "$name ($bankCode)" } } \ No newline at end of file