From b6b88d31a1213e8da9bddb7280ad52ec30d78f0f Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 26 Aug 2024 22:39:48 +0200 Subject: [PATCH] Filtering out UserCancelledAction --- .../kotlin/net/codinux/banking/ui/service/BankingService.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt index fb8465f..1551b1a 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/service/BankingService.kt @@ -74,8 +74,12 @@ class BankingService( } private fun handleUnsuccessfulBankingClientResponse(action: BankingClientAction, response: Response<*>) { + log.error { "$action was not successful: $response" } + response.error?.let { error -> - uiState.bankingClientErrorOccurred.value = BankingClientError(action, error) + if (error.type != ErrorType.UserCancelledAction) { // the user knows that she cancelled the action + uiState.bankingClientErrorOccurred.value = BankingClientError(action, error) + } } }