libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 97ab4b906bcf280790527f3c101933592fc33a56
parent a1820a97aaef36e0da8b7873dfacfa5363342045
Author: MS <ms@taler.net>
Date:   Wed, 15 Feb 2023 15:42:56 +0100

logging.

Avoid logging EBICS-ReportText when a bank-technical
error happens.

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt | 29++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt @@ -119,9 +119,9 @@ suspend fun doEbicsDownloadTransaction( // The bank gave a valid XML response but EBICS had problems. throw EbicsProtocolError( HttpStatusCode.UnprocessableEntity, - "Unexpected return code ${initResponse.technicalReturnCode}," + - " for order type $orderType and transaction ID: $transactionID," + - " at init phase.", + "EBICS-technical error at init phase: " + + "${initResponse.technicalReturnCode} ${initResponse.reportText}," + + " for order type $orderType and transaction ID: $transactionID.", initResponse.technicalReturnCode ) } @@ -142,8 +142,8 @@ suspend fun doEbicsDownloadTransaction( } else -> { logger.error( - "Bank return code at init phase was: ${initResponse.bankReturnCode}, for" + - " order type $orderType and transaction ID $transactionID." + "Bank-technical error at init phase: ${initResponse.bankReturnCode}" + + ", for order type $orderType and transaction ID $transactionID." ) return EbicsDownloadBankErrorResult(initResponse.bankReturnCode) } @@ -153,26 +153,25 @@ suspend fun doEbicsDownloadTransaction( val encryptionInfo = initResponse.dataEncryptionInfo ?: throw NexusError( HttpStatusCode.BadGateway, - "initial response did not contain encryption info. " + + "Initial response did not contain encryption info. " + "Order type $orderType, transaction ID $transactionID" ) val initOrderDataEncChunk = initResponse.orderDataEncChunk ?: throw NexusError( HttpStatusCode.BadGateway, - "initial response for download transaction does not " + - "contain data transfer. Order type $orderType, transaction ID $transactionID." + "Initial response for download transaction does not " + + "contain data transfer. Order type $orderType, " + + "transaction ID $transactionID." ) - payloadChunks.add(initOrderDataEncChunk) val numSegments = initResponse.numSegments ?: throw NexusError( HttpStatusCode.FailedDependency, - "missing segment number in EBICS download init response." + + "Missing segment number in EBICS download init response." + " Order type $orderType, transaction ID $transactionID" ) - // Transfer phase for (x in 2 .. numSegments) { val transferReqStr = @@ -187,8 +186,8 @@ suspend fun doEbicsDownloadTransaction( else -> { throw NexusError( HttpStatusCode.FailedDependency, - "unexpected EBICS technical return code at transfer phase: " + - "${transferResponse.technicalReturnCode}." + + "EBICS-technical error at transfer phase: " + + "${transferResponse.technicalReturnCode} ${transferResponse.reportText}." + " Order type $orderType, transaction ID $transactionID" ) } @@ -198,8 +197,8 @@ suspend fun doEbicsDownloadTransaction( // Success, nothing to do! } else -> { - logger.error("Bank return code " + - "at transfer phase was: ${transferResponse.bankReturnCode}." + + logger.error("Bank-technical error at transfer phase: " + + "${transferResponse.bankReturnCode}." + " Order type $orderType, transaction ID $transactionID") return EbicsDownloadBankErrorResult(transferResponse.bankReturnCode) }