diff --git a/src/clj/auto_ap/square/core.clj b/src/clj/auto_ap/square/core.clj index de229eff..80ea5395 100644 --- a/src/clj/auto_ap/square/core.clj +++ b/src/clj/auto_ap/square/core.clj @@ -268,7 +268,7 @@ output-chan (map (fn [p] (lc/with-context {:source "Square settlements loading "} - (log/info "looking up payment " p " for settlement " (:id settlement)) + (log/trace "looking up payment " p " for settlement " (:id settlement)) (or (-> (get-payment client p) :created_at @@ -415,7 +415,8 @@ :when (:square-location/client-location square-location)] (upsert-settlements client square-location))) ([client location] - (lc/with-context {:source "Square settlements loading"} + (lc/with-context {:source "Square settlements loading" + :client (:client/code client)} (doseq [x (partition-all 20 (daily-settlements client location))] (log/info "Loading expected deposit" (count x)) @(d/transact conn x)) @@ -519,9 +520,11 @@ :integration-status/message (-> data :body str)})) (catch Object e - (log/warn e) + (log/warn &throw-context) (mark-integration-status client {:integration-status/state :integration-state/failed - :integration-status/message (.getMessage (:wrapper &throw-context))})))))) + :integration-status/message (or (some-> (:wrapper &throw-context) (.getMessage )) + (some-> (:object &throw-context) str) + "Unknown error")})))))) (mount/defstate square-loader :start (scheduler/every (* 4 59 60 1000) (heartbeat upsert-all "square-loading"))