From f6a50b2799920751b47de41e1f490b1adffc0eb1 Mon Sep 17 00:00:00 2001 From: yenda Date: Fri, 28 Sep 2018 14:32:35 +0200 Subject: [PATCH] [fix 6051] log error during connexion and pass cofx Signed-off-by: yenda --- src/status_im/transport/handlers.cljs | 3 ++- test/cljs/status_im/test/transport/handlers.cljs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/status_im/transport/handlers.cljs b/src/status_im/transport/handlers.cljs index 9acdb3de22..e357df104d 100644 --- a/src/status_im/transport/handlers.cljs +++ b/src/status_im/transport/handlers.cljs @@ -46,7 +46,8 @@ (receive-message now-in-s chat-id message)) (js-array->seq js-messages))] (apply fx/merge cofx receive-message-fxs)) - (log/error "Something went wrong" js-error js-messages))) + (do (log/error "Something went wrong" js-error js-messages) + cofx))) (handlers/register-handler-fx :protocol/receive-whisper-message diff --git a/test/cljs/status_im/test/transport/handlers.cljs b/test/cljs/status_im/test/transport/handlers.cljs index 634383add8..7d5314d839 100644 --- a/test/cljs/status_im/test/transport/handlers.cljs +++ b/test/cljs/status_im/test/transport/handlers.cljs @@ -15,9 +15,9 @@ (deftest receive-whisper-messages-test (testing "an error is reported" - (is (nil? (handlers/receive-whisper-messages {:db {}} "error" #js [] nil)))) + (is (nil? (:chat-received-message/add-fx (handlers/receive-whisper-messages {:db {}} "error" #js [] nil))))) (testing "messages is undefined" - (is (nil? (handlers/receive-whisper-messages {:db {}} nil js/undefined nil)))) + (is (nil? (:chat-received-message/add-fx (handlers/receive-whisper-messages {:db {}} nil js/undefined nil))))) (testing "happy path" (let [actual (handlers/receive-whisper-messages {:db {}} nil messages sig)] (testing "it add an fx for the message"