diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/RequestExecutor.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/RequestExecutor.kt index 6bd71bca..2174d785 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/RequestExecutor.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/RequestExecutor.kt @@ -18,8 +18,7 @@ import net.dankito.utils.multiplatform.log.LoggerFactory open class RequestExecutor( protected open val messageBuilder: MessageBuilder = MessageBuilder(), protected open val webClient: IWebClient = KtorWebClient(), - protected open val base64Service: IBase64Service = PureKotlinBase64Service(), - protected open val responseParser: ResponseParser = ResponseParser() + protected open val base64Service: IBase64Service = PureKotlinBase64Service() ) { companion object { @@ -111,7 +110,7 @@ open class RequestExecutor( addMessageLog(context, MessageLogEntryType.Received, decodedResponse) - return responseParser.parse(decodedResponse) + return context.responseParser.parse(decodedResponse) } catch (e: Exception) { logError(context, "Could not decode responseBody:\r\n'$responseBody'", e) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt index d8b815be..783924e1 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt @@ -6,6 +6,7 @@ import net.dankito.banking.fints.log.MessageContext import net.dankito.banking.fints.log.MessageLogCollector import net.dankito.banking.fints.messages.datenelemente.implementierte.signatur.VersionDesSicherheitsverfahrens import net.dankito.banking.fints.response.BankResponse +import net.dankito.banking.fints.response.ResponseParser import net.dankito.banking.fints.transactions.IAccountTransactionsParser import net.dankito.banking.fints.transactions.Mt940AccountTransactionsParser import net.dankito.banking.fints.transactions.mt940.Mt940Parser @@ -33,6 +34,8 @@ open class JobContext( open val mt940Parser: IAccountTransactionsParser = Mt940AccountTransactionsParser(Mt940Parser(this), this) + open val responseParser: ResponseParser = ResponseParser(logAppender = this) + open val messageLogWithoutSensitiveData: List get() = messageLogCollector.messageLogWithoutSensitiveData diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt index 73ea308a..25a79432 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt @@ -684,7 +684,7 @@ open class ResponseParser( if (dataElements.size > dateIndex + 1) { try { time = parseTime(dataElements[dateIndex + 1]) - } catch (e: Exception) { log.error("Could not parse balance time '${dataElementGroup[dateIndex + 1]}' of data element group: $dataElementGroup") } + } catch (e: Exception) { logError("Could not parse balance time '${dataElementGroup[dateIndex + 1]}' of data element group: $dataElementGroup", e) } } return Balance(parseAmount(dataElements[1], isCredit), currency, date, time)