[PaaS only]{class="badge informative" title="Applies to Adobe Commerce on Cloud projects (Adobe-managed PaaS infrastructure) and on-premises projects only."}

ACSD-62965: Fixes missing LocalizedException message in GraphQL order placement response

The ACSD-62965 patch fixes the issue where the LocalizedException message was not included in the GraphQL response during order placement. This patch is available with the Quality Patches Tool (QPT) 1.1.57. The patch ID is ACSD-62965. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.8.

Affected products and versions

The patch is created for Adobe Commerce version:

Adobe Commerce (all deployment methods) 2.4.7

Compatible with Adobe Commerce versions:

Adobe Commerce (all deployment methods) 2.4.7 - 2.4.7-p3

NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

The GraphQL response for order placement does not include a LocalizedException message, resulting in insufficient error details for debugging.

Steps to reproduce:

  1. Install a clean Adobe Commerce instance.

  2. Add a product to the cart and proceed to the order placement step.

  3. Add a LocalizedException to Magento\Framework\Exception\LocalizedException in app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php.

  4. Insert the exception after the following line:

    code language-none
    $cart = $this->getCartForCheckout->execute($maskedCartId, $userId, $storeId);
    

    Add the exception:

    code language-none
    throw new LocalizedException(new Phrase("Test LocalizedException"));
    
  5. Execute the place order GraphQL request:

    code language-none
    mutation {
    placeOrder(input: {cart_id: "cart_id"}) {
        order {
        order_number
        }
    }
    }
    
  6. Observe the response:

    1. The response does not include the LocalizedException message.

    2. Example of the incorrect response:

      code language-none
      {
      "data": {
          "placeOrder": {
          "order": null
          }
      }
      }
      

Expected results:

If a LocalizedException occurs, the exception message should be included in the order placement GraphQL response for improved error handling.

Actual results:

If a LocalizedException occurs, the exception message is not included in the order placement GraphQL response.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3