From 60add52752126b002f1598e3f979f0196480d40b Mon Sep 17 00:00:00 2001 From: Oleksandr Dubovyk Date: Mon, 29 Aug 2016 12:42:24 +0300 Subject: [PATCH] MAGETWO-57726: Exception is created but not thrown #6320 --- app/code/Magento/Reports/Block/Product/AbstractProduct.php | 2 +- .../Reports/Model/ResourceModel/Product/Lowstock/Collection.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;