Showing received response in debugger

This commit is contained in:
dankl 2019-10-06 14:28:12 +02:00 committed by dankito
parent 37f73f54b5
commit 676a7f0b71
1 changed files with 8 additions and 1 deletions

View File

@ -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"
}
}