From f998d78c3a25002818e707c8241163593406d878 Mon Sep 17 00:00:00 2001 From: asim-blueprintprep Date: Mon, 21 Jul 2025 15:58:08 +0100 Subject: [PATCH] Adds SKU or ID into the exception error log message --- app/code/Magento/Catalog/Model/ProductRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ProductRepository.php b/app/code/Magento/Catalog/Model/ProductRepository.php index 4343917f250a0..b3fad41273050 100644 --- a/app/code/Magento/Catalog/Model/ProductRepository.php +++ b/app/code/Magento/Catalog/Model/ProductRepository.php @@ -285,7 +285,7 @@ public function get($sku, $editMode = false, $storeId = null, $forceReload = fal $productId = $this->resourceModel->getIdBySku($sku); if (!$productId) { throw new NoSuchEntityException( - __("The product that was requested doesn't exist. Verify the product and try again.") + __("The product with the SKU: " . $sku . " was requested and doesn't exist. Verify the product and try again.") ); } if ($editMode) { @@ -319,7 +319,7 @@ public function getById($productId, $editMode = false, $storeId = null, $forceRe $product->load($productId); if (!$product->getId()) { throw new NoSuchEntityException( - __("The product that was requested doesn't exist. Verify the product and try again.") + __("The product with the ID: " . $productId ." was requested and doesn't exist. Verify the product and try again.") ); } $this->cacheProduct($cacheKey, $product);