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

Any reason for not printing Exception Message in ObjectManager\Factory\AbstractFactory::createObject? #26550

Closed
marvinhinz opened this issue Jan 27, 2020 · 6 comments · Fixed by #26572
Assignees
Labels
Component: ObjectManager feature request Fixed in 2.4.x The issue has been fixed in 2.4-develop branch improvement Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. Triage: Done Has been reviewed and prioritized during Triage with Product Managers

Comments

@marvinhinz
Copy link
Contributor

Summary (*)

When debugging an error that prevents object creation, the original exception message is not printed, its just logged. I think it would improve the developer experience when working on cli code, to see the message instantly and not having it to look up in the log.

Source of the RuntimeException:
magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php::createObject

Examples (*)

CLI Output:

In AbstractFactory.php line 124:
  [Magento\Framework\Exception\RuntimeException]                               
  Type Error occurred when creating object:   
  Leonex\Import\Model\Transformer\ProductData\Categories
  Exception trace: [...]

system.log:

[2020-01-27 11:36:15] main.CRITICAL: Type Error occurred when creating object: Leonex\Import\Model\Transformer\ProductData\Categories, Too few arguments to function Leonex\ETL\Logger\AbstractLog::__construct(), 0 passed in /srv/projects/rb/htdocs/magento/app/code/Leonex/Import/Model/Transformer/ProductData/Categories.php on line 63 and exactly 1 expected [] []

Proposed solution

Printing the exception message too.

@m2-assistant
Copy link

m2-assistant bot commented Jan 27, 2020

Hi @marvinhinz. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

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

@marvinhinz do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jan 27, 2020
@engcom-Hotel engcom-Hotel self-assigned this Jan 28, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jan 28, 2020

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel
Copy link
Contributor

Hello @sdzhepa
This issue looks like feature request. Could you transfer this issue to the feature request repository?
Thanks for collaboration!

marvinhinz added a commit to marvinhinz/magento2 that referenced this issue Jan 29, 2020
…ory::createObject now contains the reason.

This implements feature request magento#26550
@ghost ghost assigned marvinhinz Jan 29, 2020
@magento-engcom-team magento-engcom-team added this to PR In Progress in Community Backlog Mar 24, 2020
@ghost ghost added the Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. label May 8, 2020
@ghost ghost added the Priority: P3 May be fixed according to the position in the backlog. label May 19, 2020
@sdzhepa sdzhepa added Component: ObjectManager Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Done Has been reviewed and prioritized during Triage with Product Managers labels May 20, 2020
@slavvka slavvka added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label May 21, 2020
@slavvka
Copy link
Member

slavvka commented May 21, 2020

Hi @marvinhinz. Thank you for your report.
The issue has been fixed in #26572 by @marvinhinz in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.0 release.

@slavvka slavvka closed this as completed May 21, 2020
@ghost ghost moved this from PR In Progress to Done (last 30 days) in Community Backlog May 21, 2020
@magento-engcom-team magento-engcom-team removed this from Done (last 30 days) in Community Backlog May 21, 2020
@magento-engcom-team
Copy link
Contributor

Based on the provided information internal tickets MC-34529 were created.

@sdzhepa sdzhepa added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label May 21, 2020
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label May 21, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @sdzhepa
Thank you for verifying the issue. Based on the provided information internal tickets MC-34529 were created

Issue Available: @sdzhepa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ObjectManager feature request Fixed in 2.4.x The issue has been fixed in 2.4-develop branch improvement Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. Triage: Done Has been reviewed and prioritized during Triage with Product Managers
Projects
None yet
5 participants