This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-03-05
Channels
- # aleph (90)
- # announcements (4)
- # aws (2)
- # beginners (61)
- # calva (2)
- # cljs-dev (8)
- # cljsrn (12)
- # clojars (4)
- # clojure (42)
- # clojure-europe (1)
- # clojure-finland (1)
- # clojure-greece (2)
- # clojure-houston (1)
- # clojure-italy (3)
- # clojure-nl (30)
- # clojure-spec (41)
- # clojure-uk (87)
- # clojurescript (44)
- # cursive (12)
- # data-science (11)
- # datomic (24)
- # defnpodcast (1)
- # fulcro (18)
- # hyperfiddle (1)
- # jobs (2)
- # juxt (11)
- # kaocha (3)
- # london-clojurians (5)
- # mount (2)
- # nrepl (2)
- # off-topic (9)
- # onyx (25)
- # other-languages (1)
- # parinfer (3)
- # pathom (5)
- # pedestal (3)
- # portkey (1)
- # re-frame (21)
- # reagent (24)
- # remote-jobs (7)
- # schema (2)
- # shadow-cljs (59)
- # spacemacs (5)
- # specter (7)
- # sql (9)
- # tools-deps (13)
curious about error handling. I am doing something like this:
(defn log-error-response [response]
(let [throwable (:cognitect.aws.client/throwable response)
category (:cognitect.anomalies/category response)
default-message "An error occurred during AWS client invocation."
message (or (:message response) default-message)]
(when category
(let [e (ex-info message response)]
(if throwable
(log/error throwable message)
(log/error e message))))
response))
Is this good enough to "catch 'em all"?I tossed throwable
in there because I saw for instance, when an unbound var was referenced in the body of a call to aws/invoke, I got one of these:
{:cognitect.anomalies/category :cognitect.anomalies/fault,
:cognitect.aws.client/throwable #error {
:cause "Don't know how to write JSON of class clojure.lang.Var$Unbound"
which contains no :message
key. I suppose the other question is where I can rely on :message
to be there.