Skip to content

Commit 7e4b997

Browse files
committed
ACP2E-3009: async.operations.all executed and created an error.
1 parent 1325946 commit 7e4b997

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/code/Magento/Catalog/Model/ProductLink/Repository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ public function __construct(
134134
public function save(\Magento\Catalog\Api\Data\ProductLinkInterface $entity)
135135
{
136136
if (!$entity->getSku()) {
137-
throw new NoSuchEntityException(__(
137+
throw new CouldNotSaveException(__(
138138
'The parent product SKU is required for linking child products. '
139139
. 'Please ensure the parent product SKU is provided and try again.'
140140
));
141141
}
142142
if (!$entity->getLinkedProductSku()) {
143-
throw new NoSuchEntityException(__('The linked product SKU is invalid. Verify the data and try again.'));
143+
throw new CouldNotSaveException(__('The linked product SKU is invalid. Verify the data and try again.'));
144144
}
145145
$linkedProduct = $this->productRepository->get($entity->getLinkedProductSku());
146146
$product = $this->productRepository->get($entity->getSku());

app/code/Magento/Catalog/Test/Unit/Model/ProductLink/RepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function testSaveWithoutLinkedProductSku()
192192

193193
public function testSaveWithoutProductSku()
194194
{
195-
$this->expectException('Magento\Framework\Exception\NoSuchEntityException');
195+
$this->expectException('Magento\Framework\Exception\CouldNotSaveException');
196196
$this->expectExceptionMessage(
197197
'The parent product SKU is required for linking child products. '
198198
. 'Please ensure the parent product SKU is provided and try again.'

0 commit comments

Comments
 (0)