-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Catch throwable errors during model save (rollback) #32558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch throwable errors during model save (rollback) #32558
Conversation
Hi @Sekiphp. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
@magento create issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Sekiphp!
Thank you for your contribution!
According to our Definition of Done, all new changes should be covered with corresponding auto-tests.
May I ask you to add unit-tests coverage for this specific case?
@swnsma I tried to add unit test, but I usually using another testing framework and I had problem to make this test working. Can you please give me some suggestion what to edit/fix in this tests? Thank you! |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Hi I am closing this PR for now as it seems like it has become stale and still needs work. Please feel free to reopen if you wish to continue. Thanks! |
@ishakhsuvarov Can you please reopen this pull request? Automated tests are already written.... |
Description (*)
When you throw
Error
class (or some inherited class) inbeforeSave
method - Magento do not rollback started transaction correctly.You can look at similar pull request for OpenMage project: OpenMage/magento-lts#1483
Exception implements Throwable
- so this change should be unbreakableManual testing scenarios (*)
throw new Error('error from some specifiec reason');
Contribution checklist (*)
Resolved issues: