diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php index d307055f22bbf..5a83fa3e34fa8 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php @@ -144,6 +144,7 @@ public function execute() $this->messageManager->addSuccess(__('You duplicated the product.')); } } catch (\Magento\Framework\Exception\LocalizedException $e) { + $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); $this->messageManager->addError($e->getMessage()); $this->getDataPersistor()->set('catalog_product', $data); $redirectBack = $productId ? true : 'new'; diff --git a/app/code/Magento/Catalog/Model/ProductRepository.php b/app/code/Magento/Catalog/Model/ProductRepository.php index ceacfea5ec020..c91ae62544615 100644 --- a/app/code/Magento/Catalog/Model/ProductRepository.php +++ b/app/code/Magento/Catalog/Model/ProductRepository.php @@ -634,7 +634,7 @@ public function save(\Magento\Catalog\Api\Data\ProductInterface $product, $saveO } catch (LocalizedException $e) { throw $e; } catch (\Exception $e) { - throw new \Magento\Framework\Exception\CouldNotSaveException(__('Unable to save product')); + throw new \Magento\Framework\Exception\CouldNotSaveException(__('Unable to save product'), $e); } unset($this->instances[$product->getSku()]); unset($this->instancesById[$product->getId()]);