magento2
magento2 copied to clipboard
Exception is not getting handled properly while adding a product to cart in the compare product page
Preconditions and environment
- Magento version 2.4.6-p3
- PHP 8.1.18
- MySql 8.0.35-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
Steps to reproduce
- Login into the Magento using customer credentials
- Add a product to the compare list
- Got to my account page
- Click on compare
- Add the product to cart [In my case there was a Localized Exception thrown while adding it to the cart, there is a catch block in vendor/magento/module-checkout/Controller/Cart/Add.php line 164, but the exception is not caught and handled properly, instead JSON encoded page is returned]
Expected result
The exception should be handled and a message manager message should be displayed in the controller.
Actual result
The above-mentioned page is loaded with a JSON response
Additional information
No response
Release note
No response
Triage and priority
- [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- [X] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.