Skip to content

[Issue] Catch throwable errors during model save (rollback) #32562

Open
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #32558: Catch throwable errors during model save (rollback)


Description (*)

When you throw Error class (or some inherited class) in beforeSave 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 unbreakable

Manual testing scenarios (*)

  1. throw new Error('error from some specifiec reason');

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrameworkComponent: CodeComponent: ModelIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: ready for devReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions