Skip to content

Commit f3aaa2e

Browse files
authored
Add info to error log which product failed adding to quote (#83)
1 parent a5859f6 commit f3aaa2e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Model/OrderImporter/Creator.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,15 @@ private function processItems(Quote $quote, CheckoutFormInterface $checkoutForm)
220220
$lineItemsIds[$product->getSku()] = $lineItem->getId();
221221
$product->setPrice($lineItem->getPrice()->getAmount());
222222
$product->setSpecialPrice(null);
223-
$quote->addProduct($product, $lineItem->getQty());
223+
try {
224+
$quote->addProduct($product, $lineItem->getQty());
225+
} catch (LocalizedException $e) {
226+
throw new CreatorItemsException(
227+
"Error while trying to add product with sku {$product->getSku()} to quote",
228+
1602070926,
229+
$e
230+
);
231+
}
224232
}
225233
return $lineItemsIds;
226234
}

0 commit comments

Comments
 (0)