aws

Ruben Sevaldson 2024-05-28T12:28:15.730259Z

Beginner question: What is the recommended way to check if an error occurred when using aws-api? Specifically the invoke function. In the Readme it says

Barring client side exceptions, every operation on every AWS service returns a map. If the operation is successful, the map is in the shape described by (-> client aws/ops op :response). 
But i'm not sure how to use that to check for errors in a nice way.

rutledgepaulv 2024-05-28T21:05:20.111919Z

(defn anomaly? [x]
  (and (map? x) (contains? x :cognitect.anomalies/category)))

rutledgepaulv 2024-05-28T21:05:55.785289Z

https://github.com/cognitect-labs/anomalies

Ruben Sevaldson 2024-05-29T06:57:49.551579Z

Thanks 🙂