From 676a7f0b7110d61f42f8ad2981e3fad272e21e71 Mon Sep 17 00:00:00 2001 From: dankl Date: Sun, 6 Oct 2019 14:28:12 +0200 Subject: [PATCH] Showing received response in debugger --- .../main/kotlin/net/dankito/fints/response/Response.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/response/Response.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/response/Response.kt index c7945e67..1cb2c828 100644 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/response/Response.kt +++ b/fints4javaLib/src/main/kotlin/net/dankito/fints/response/Response.kt @@ -1,5 +1,6 @@ package net.dankito.fints.response +import net.dankito.fints.messages.Separators import net.dankito.fints.messages.segmente.id.ISegmentId import net.dankito.fints.messages.segmente.id.MessageSegmentId import net.dankito.fints.response.segments.ReceivedMessageHeader @@ -39,7 +40,13 @@ open class Response( override fun toString(): String { - return "Successful? $successful" + val formattedResponse = receivedResponse?.replace(Separators.SegmentSeparator, System.lineSeparator()) ?: "" + + if (successful) { + return formattedResponse + } + + return "Error: $error\n$formattedResponse" } } \ No newline at end of file