File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Test/Unit/Model/ProductLink Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff 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 ());
Original file line number Diff line number Diff 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. '
You can’t perform that action at this time.
0 commit comments