Displaying now also response code to user. May she then can help us better (or she may even knows what to do with this information)
This commit is contained in:
parent
0303f94bee
commit
e4aa38e11f
|
@ -62,18 +62,26 @@ open class BankResponse(
|
||||||
get() {
|
get() {
|
||||||
val errorMessages = segmentFeedbacks
|
val errorMessages = segmentFeedbacks
|
||||||
.flatMap { it.feedbacks }
|
.flatMap { it.feedbacks }
|
||||||
.mapNotNull { if (it.isError) it.message else null }
|
.mapNotNull { mapToMessageToShowToUser(it) }
|
||||||
.toMutableList()
|
.toMutableList()
|
||||||
|
|
||||||
messageFeedback?.let { messageFeedback ->
|
messageFeedback?.let { messageFeedback ->
|
||||||
if (messageFeedback.isError) {
|
if (messageFeedback.isError) {
|
||||||
errorMessages.addAll(0, messageFeedback.feedbacks.mapNotNull { if (it.isError) it.message else null })
|
errorMessages.addAll(0, messageFeedback.feedbacks.mapNotNull { mapToMessageToShowToUser(it) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return errorMessages
|
return errorMessages
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected open fun mapToMessageToShowToUser(feedback: Feedback): String? {
|
||||||
|
if (feedback.isError) {
|
||||||
|
return "${feedback.responseCode}: ${feedback.message}"
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
open var followUpResponse: BankResponse? = null
|
open var followUpResponse: BankResponse? = null
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue