From 981444ad7cc921dab24f14c1eb159a77583fd186 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Sun, 22 Mar 2020 11:33:48 +0100 Subject: [PATCH] Handle/report twitter errors --- mastodon_bot/core.cljs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mastodon_bot/core.cljs b/mastodon_bot/core.cljs index bb47c75..1394da1 100755 --- a/mastodon_bot/core.cljs +++ b/mastodon_bot/core.cljs @@ -179,9 +179,11 @@ (defn post-tweets [last-post-time] (fn [error tweets response] - (->> (js->edn tweets) - (map parse-tweet) - (post-items last-post-time)))) + (if (nil? error) + (->> (js->edn tweets) + (map parse-tweet) + (post-items last-post-time)) + (exit-with-error error)))) (defn strip-utm [news-link] (first (string/split news-link #"\?utm")))