Makes square more resilent when catalog changes
This commit is contained in:
@@ -141,15 +141,23 @@
|
|||||||
(defn item->category-name-impl [client item ]
|
(defn item->category-name-impl [client item ]
|
||||||
(capture-context->lc
|
(capture-context->lc
|
||||||
(cond (:item_id (:item_variation_data item))
|
(cond (:item_id (:item_variation_data item))
|
||||||
(de/chain (fetch-catalog-cache client (:item_id (:item_variation_data item)))
|
(de/catch (de/chain (fetch-catalog-cache client (:item_id (:item_variation_data item)))
|
||||||
(fn [item]
|
(fn [item]
|
||||||
(mu/with-context lc
|
(mu/with-context lc
|
||||||
(item->category-name-impl client item))))
|
(item->category-name-impl client item))))
|
||||||
|
(fn [e]
|
||||||
|
(log/error ::couldnt-fetch-variation
|
||||||
|
:exception e)
|
||||||
|
"Uncategorized"))
|
||||||
|
|
||||||
(:category_id (:item_data item))
|
(:category_id (:item_data item))
|
||||||
(de/chain (fetch-catalog-cache client (:category_id (:item_data item)))
|
(de/catch (de/chain (fetch-catalog-cache client (:category_id (:item_data item)))
|
||||||
:category_data
|
:category_data
|
||||||
:name)
|
:name)
|
||||||
|
(fn [e]
|
||||||
|
(log/error ::couldnt-fetch-category
|
||||||
|
:exception e)
|
||||||
|
"Uncategorized"))
|
||||||
|
|
||||||
(:item_data item)
|
(:item_data item)
|
||||||
"Uncategorized"
|
"Uncategorized"
|
||||||
|
|||||||
Reference in New Issue
Block a user