diff --git a/src/clj/auto_ap/square/core3.clj b/src/clj/auto_ap/square/core3.clj index 125a1065..4e8cf5bd 100644 --- a/src/clj/auto_ap/square/core3.clj +++ b/src/clj/auto_ap/square/core3.clj @@ -141,15 +141,23 @@ (defn item->category-name-impl [client item ] (capture-context->lc (cond (:item_id (:item_variation_data item)) - (de/chain (fetch-catalog-cache client (:item_id (:item_variation_data item))) - (fn [item] - (mu/with-context lc - (item->category-name-impl client item)))) + (de/catch (de/chain (fetch-catalog-cache client (:item_id (:item_variation_data item))) + (fn [item] + (mu/with-context lc + (item->category-name-impl client item)))) + (fn [e] + (log/error ::couldnt-fetch-variation + :exception e) + "Uncategorized")) (:category_id (:item_data item)) - (de/chain (fetch-catalog-cache client (:category_id (:item_data item))) - :category_data - :name) + (de/catch (de/chain (fetch-catalog-cache client (:category_id (:item_data item))) + :category_data + :name) + (fn [e] + (log/error ::couldnt-fetch-category + :exception e) + "Uncategorized")) (:item_data item) "Uncategorized"