diff --git a/vendor/magento/module-quote-graph-ql/Model/Cart/GetCartForUser.php b/vendor/magento/module-quote-graph-ql/Model/Cart/GetCartForUser.php index af70809..2bd9f32 100644 --- a/vendor/magento/module-quote-graph-ql/Model/Cart/GetCartForUser.php +++ b/vendor/magento/module-quote-graph-ql/Model/Cart/GetCartForUser.php @@ -70,7 +70,9 @@ class GetCartForUser $cartId = $this->maskedQuoteIdToQuoteId->execute($cartHash); } catch (NoSuchEntityException $exception) { throw new GraphQlNoSuchEntityException( - __('Could not find a cart with ID "%masked_cart_id"', ['masked_cart_id' => $cartHash]) + __('Could not find a cart with ID "%masked_cart_id"', ['masked_cart_id' => $cartHash]), + null, + 209 ); } @@ -79,12 +81,17 @@ class GetCartForUser $cart = $this->cartRepository->get($cartId); } catch (NoSuchEntityException $e) { throw new GraphQlNoSuchEntityException( - __('Could not find a cart with ID "%masked_cart_id"', ['masked_cart_id' => $cartHash]) + __('Could not find a cart with ID "%masked_cart_id"', ['masked_cart_id' => $cartHash]), + null, + 209 ); } if (false === (bool)$cart->getIsActive()) { - throw new GraphQlNoSuchEntityException(__('The cart isn\'t active.')); + throw new GraphQlNoSuchEntityException(__('The cart isn\'t active.'), + null, + 209 + ); } $this->updateCartCurrency($cart, $storeId); @@ -101,7 +108,9 @@ class GetCartForUser __( 'The current user cannot perform operations on cart "%masked_cart_id"', ['masked_cart_id' => $cartHash] - ) + ), + null, + 209 ); } return $cart; @@ -123,7 +132,9 @@ class GetCartForUser $newStore = $this->storeRepository->getById($storeId); if ($cartStore->getWebsite() !== $newStore->getWebsite()) { throw new GraphQlInputException( - __('Can\'t assign cart to store in different website.') + __('Can\'t assign cart to store in different website.'), + null, + 209 ); } $cart->setStoreId($storeId);