aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
devn 2019-03-05T22:38:21.062800Z

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

devn 2019-03-05T22:57:00.064500Z

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.