Skip to content

Commit 750ec9d

Browse files
MSI Inventory logs improved (#716)
* MSI Inventory logs improved * log fixed
1 parent 1978882 commit 750ec9d

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

app/code/Meta/Catalog/Model/Product/Feed/Builder/MultiSourceInventory.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,16 @@ private function isInStock(Product $product, int $stockId): bool
132132
$stockId
133133
);
134134
} catch (\Exception $e) {
135+
$this->fbeHelper->logExceptionImmediatelytoMeta(
136+
$e,
137+
[
138+
'store_id' => $this->product->getStoreId(),
139+
'event' => 'catalog_sync',
140+
'event_type' => 'multi_source_inventory_sync_get_stock_status_error',
141+
'product_id' => $this->product->getSku(),
142+
'stock_id' => $stockId
143+
]
144+
);
135145
return false;
136146
}
137147
}
@@ -151,6 +161,16 @@ private function getStockQty(Product $product, int $stockId)
151161
$stockId
152162
);
153163
} catch (\Exception $e) {
164+
$this->fbeHelper->logExceptionImmediatelytoMeta(
165+
$e,
166+
[
167+
'store_id' => $this->product->getStoreId(),
168+
'event' => 'catalog_sync',
169+
'event_type' => 'multi_source_inventory_sync_get_stock_qty_error',
170+
'product_id' => $this->product->getSku(),
171+
'stock_id' => $stockId
172+
]
173+
);
154174
return 0;
155175
}
156176
}
@@ -173,7 +193,8 @@ public function isStockManagedForProduct(): bool
173193
[
174194
'store_id' => $this->product->getStoreId(),
175195
'event' => 'catalog_sync',
176-
'event_type' => 'multi_source_inventory_sync_error'
196+
'event_type' => 'multi_source_inventory_sync_error',
197+
'product_id' => $this->product->getSku()
177198
]
178199
);
179200
try {

0 commit comments

Comments
 (0)