Skip to content
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

improve exception handling in Layout render #27478

Merged
merged 3 commits into from
Aug 19, 2020

Conversation

fsw
Copy link
Member

@fsw fsw commented Mar 27, 2020

Description (*)

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.

Manual testing scenarios (*)

  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.

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)

Resolved issues:

  1. resolves [Issue] improve exception handling in Layout render #29606: improve exception handling in Layout render

@m2-assistant
Copy link

m2-assistant bot commented Mar 27, 2020

Hi @fsw. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@rogyar
Copy link
Contributor

rogyar commented Aug 9, 2020

Hi @engcom-Charlie. The fix is good to go. But we still need the to cover it at least with a unit test.
Thank you

@engcom-Charlie
Copy link
Contributor

@magento run all tests

@rogyar rogyar added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: test coverage labels Aug 11, 2020
@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-7994 has been created to process this Pull Request

@sdzhepa sdzhepa added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Aug 11, 2020
@sidolov sidolov added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Aug 17, 2020
@sidolov
Copy link
Contributor

sidolov commented Aug 17, 2020

@magento create issue

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Add throw new \Exception('test exception'); in a template.

Before: ✖️ All exception messages are logged to system log

Screenshot from 2020-08-18 12-41-45

After: ✔️ Messages are logged to exception log file

Screenshot from 2020-08-18 12-40-36

@engcom-Charlie engcom-Charlie added the QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) label Aug 18, 2020
@engcom-Alfa engcom-Alfa added QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope and removed QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) labels Aug 18, 2020
@magento-engcom-team magento-engcom-team merged commit 441b0af into magento:2.4-develop Aug 19, 2020
@m2-assistant
Copy link

m2-assistant bot commented Aug 19, 2020

Hi @fsw, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@sidolov sidolov added this to the 2.4.2 milestone Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: test coverage Component: View Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Issue] improve exception handling in Layout render
7 participants