Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Remove try-catch construction #1002

Merged
merged 2 commits into from
Oct 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ public function execute(array $cartItemData): array

if (isset($cartItemData['data']) && isset($cartItemData['data']['sku'])) {
$sku = $cartItemData['data']['sku'];

try {
$product = $this->productRepository->get($sku);
} catch (NoSuchEntityException $e) {
throw new GraphQlNoSuchEntityException(__('Could not find specified product.'));
}
$product = $this->productRepository->get($sku);

if ($product->getLinksPurchasedSeparately() && isset($cartItemData['downloadable_product_links'])) {
$downloadableLinks = $cartItemData['downloadable_product_links'];
Expand Down