diff --git a/app/code/Magento/Reports/Block/Product/AbstractProduct.php b/app/code/Magento/Reports/Block/Product/AbstractProduct.php index 9a142b2f98217..1bd340cd71847 100644 --- a/app/code/Magento/Reports/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Reports/Block/Product/AbstractProduct.php @@ -90,7 +90,7 @@ public function getModel() try { $model = $this->_indexFactory->get($this->_indexType); } catch (\InvalidArgumentException $e) { - new \Magento\Framework\Exception\LocalizedException(__('Index type is not valid')); + throw new \Magento\Framework\Exception\LocalizedException(__('Index type is not valid')); } return $model; diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php index c5fd7b09fa252..f3a142a12e596 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php @@ -249,7 +249,7 @@ public function joinInventoryItem($fields = []) public function filterByProductType($typeFilter) { if (!is_string($typeFilter) && !is_array($typeFilter)) { - new \Magento\Framework\Exception\LocalizedException(__('The product type filter specified is incorrect.')); + throw new \Magento\Framework\Exception\LocalizedException(__('The product type filter specified is incorrect.')); } $this->addAttributeToFilter('type_id', $typeFilter); return $this;