BO: Hide raw exception on state delete failure#40742
Conversation
|
Hello @mattiaclementi! This is your first pull request on PrestaShop repository of the PrestaShop project. Thank you, and welcome to this Open Source community! |
|
Thanks you, I launched the CI. That way, the e-merchant won't try a second or third time... |
|
cc @kpodemski for wording |
|
This pull request seems to contain new translation strings. I have summarized them below to ease up review:
(Note: this is an automated message, but answering it will reach a real human) |
It is a good idea, i've change the message to be much clearer. |
Hlavtox
left a comment
There was a problem hiding this comment.
Guys, this is not proper, the state can be deleted from multiple reasons, not only because the state is used.
The exception must be universal.
If needed, you can throw different exceptions with different messages. 👍
c87f143 to
169f62e
Compare
You're right! Sorry, I deleted the last commit, so the message is generic again. |
169f62e to
36c1bef
Compare
jolelievre
left a comment
There was a problem hiding this comment.
The integration test is maybe a bit overkill for such improvement But thank you for the accuracy
SiraDIOP
left a comment
There was a problem hiding this comment.
Hello @mattiaclementi,
Thank you for your PR, I've tested this locally and everything looks good. However, I'm unable to approve the merge yet as the CI checks are still pending. I'll approve them and we'll see if everything passes! 🙂
Enregistrement.de.l.ecran.2026-02-26.a.19.16.54.mov
Thank you
294fe2d
36c1bef to
294fe2d
Compare
Hi @SiraDIOP, i've force push a commit with the fix for header of |
294fe2d to
fa86a0a
Compare
kpodemski
left a comment
There was a problem hiding this comment.
Hello @mattiaclementi
The only thing missing is to fix the license header in the test file you added. We've recently changed the format of the license header and added a CI checks for it.
14e32b5 to
9f06105
Compare
Hello @kpodemski |
9f06105 to
5b6c593
Compare
DeleteStateException::FAILED_DELETEin the State BO controller to avoid exposing raw exception messages. Add an integration test ensuring an error flash is shown when delete fails.An error occurred while deleting the object.(no raw exception message) 2) Runphp vendor/bin/phpunit tests/Integration/PrestaShopBundle/Controller/Admin/Improve/International/StateControllerTest.php