From 2a4cdd48fe6f4b4e9f40e3ada4c49fb6557a9989 Mon Sep 17 00:00:00 2001 From: Anton Rozhkov Date: Mon, 7 Aug 2023 19:00:58 +0600 Subject: [PATCH] fix map events --- .../src/main/java/vivid/money/elmslie/core/store/Actor.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elmslie-core/src/main/java/vivid/money/elmslie/core/store/Actor.kt b/elmslie-core/src/main/java/vivid/money/elmslie/core/store/Actor.kt index 4ae52096..29652f68 100644 --- a/elmslie-core/src/main/java/vivid/money/elmslie/core/store/Actor.kt +++ b/elmslie-core/src/main/java/vivid/money/elmslie/core/store/Actor.kt @@ -16,5 +16,5 @@ abstract class Actor { eventMapper: (T) -> Event? = { null }, errorMapper: (error: Throwable) -> Event? = { null }, ) = mapNotNull { eventMapper(it) } - .catch { errorMapper(it) ?: throw it } + .catch { errorMapper(it)?.let { event -> emit(event) } ?: throw it } }