Fixed that ResponseParser logs didn't get added to LogCollector; had therefore to add ResponseParser to JobContext
This commit is contained in:
parent
eba94e2c1b
commit
7ad0656c9b
|
@ -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)
|
||||
|
||||
|
|
|
@ -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<MessageLogEntry>
|
||||
get() = messageLogCollector.messageLogWithoutSensitiveData
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue