Skip to content

[Issue] improve exception handling in Layout render #29606

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #27478: improve exception handling in Layout render


Preconditions (*)

When layout is being rendered in production mode, all exception messages are logged to system log as critical issues. However exception stack is lost. If we pass exception to LoggerInterface::critical instead this data will be saved to var/report.

Steps to reproduce (*)

  1. Add throw \Exception('test'); in a template.
  2. Validate that after rendering such a template, exception stack is being saved to var/report in addition to its message being logged.

Actual Result: (*)

✖️ All exception messages are logged to system log

Expected Result:

✔️ Messages should be logged to the exception log file

Questions or comments

  1. Is passing Exception to LoggerInterface::critical a preferred way of logging issues? (I see it being used this way in other places)
  2. Was saving non translated message in case of LocalizedException adding any value?

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

    Component: ViewFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P2A defect with this priority could have functionality issues which are not to expectations.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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions