Skip to content

Commit 851df6d

Browse files
committed
GraphQL-350: "The requested qty is not available" should be received instead of Internal server error
1 parent 3cc39cd commit 851df6d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/code/Magento/QuoteGraphQl/Model/Cart/AddSimpleProductToCart.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ public function execute(Quote $cart, array $cartItemData): void
7979
$result = $cart->addProduct($product, $this->createBuyRequest($qty, $customizableOptions));
8080
} catch (\Exception $e) {
8181
throw new GraphQlInputException(
82-
__('Shopping cart error with SKU \'%sku\': %message', ['sku' => $sku, 'message' => $e->getMessage()])
82+
__(
83+
'Could not add the product with SKU %sku to the shopping cart: %message',
84+
['sku' => $sku, 'message' => $e->getMessage()]
85+
)
8386
);
8487
}
8588

0 commit comments

Comments
 (0)