From 56421bc2842f0f2ee084bfc1265719083ff31526 Mon Sep 17 00:00:00 2001 From: "dmitri.sotnikov@gmail.com" Date: Thu, 15 Mar 2018 10:08:31 -0400 Subject: [PATCH] updated to exit gracefully when config is invalid --- mastodon-bot.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mastodon-bot.cljs b/mastodon-bot.cljs index 5f81fed..089ddba 100755 --- a/mastodon-bot.cljs +++ b/mastodon-bot.cljs @@ -20,7 +20,9 @@ (def config (-> (find-config) fs/readFileSync str edn/read-string)) (def mastodon-client (or (some-> config :mastodon clj->js mastodon.) - (js/console.error "missing Mastodon client configuration!"))) + (do + (js/console.error "missing Mastodon client configuration!") + (js/process.exit 1)))) (defn js->edn [data] (js->clj data :keywordize-keys true))