Skip to content

Commit 198dcfd

Browse files
MAGETWO-69780: Improved error logging: original exception was not passed as $cause #9890
2 parents b9dc459 + 2334da7 commit 198dcfd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public function execute()
144144
$this->messageManager->addSuccess(__('You duplicated the product.'));
145145
}
146146
} catch (\Magento\Framework\Exception\LocalizedException $e) {
147+
$this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
147148
$this->messageManager->addError($e->getMessage());
148149
$this->getDataPersistor()->set('catalog_product', $data);
149150
$redirectBack = $productId ? true : 'new';

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ public function save(\Magento\Catalog\Api\Data\ProductInterface $product, $saveO
634634
} catch (LocalizedException $e) {
635635
throw $e;
636636
} catch (\Exception $e) {
637-
throw new \Magento\Framework\Exception\CouldNotSaveException(__('Unable to save product'));
637+
throw new \Magento\Framework\Exception\CouldNotSaveException(__('Unable to save product'), $e);
638638
}
639639
unset($this->instances[$product->getSku()]);
640640
unset($this->instancesById[$product->getId()]);

0 commit comments

Comments
 (0)