[fix 6051] log error during connexion and pass cofx

Signed-off-by: yenda <eric@status.im>
This commit is contained in:
yenda 2018-09-28 14:32:35 +02:00
parent c289b0bfb2
commit f6a50b2799
No known key found for this signature in database
GPG Key ID: 0095623C0069DCE6
2 changed files with 4 additions and 3 deletions

View File

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

View File

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