From a98da5fb2f7788a454bd062b3c7222968efb7745 Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Tue, 31 Oct 2017 08:50:16 +0200 Subject: [PATCH] Error handling for hubspot contact create --- src/clj/commiteth/routes/redirect.clj | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/clj/commiteth/routes/redirect.clj b/src/clj/commiteth/routes/redirect.clj index a837161..f006f9c 100644 --- a/src/clj/commiteth/routes/redirect.clj +++ b/src/clj/commiteth/routes/redirect.clj @@ -48,8 +48,11 @@ user (assoc (get-or-create-user access-token) token-key access-token)] (when new-user? - (hubspot/create-hubspot-contact (:email user) - (:name user "") - (:login user))) + (try + (hubspot/create-hubspot-contact (:email user) + (:name user "") + (:login user)) + (catch Throwable t + (log/error "Failed to create hubspot contact" t)))) (assoc (found (str (env :server-address) "/app")) :session {:identity user}))))))