Skip to content

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

Closed
@marvinhinz

Description

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.

Metadata

Labels

Component: ObjectManagerFixed 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: P3May be fixed according to the position in the backlog.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S4Affects aesthetics, professional look and feel, “quality” or “usability”.Triage: DoneHas been reviewed and prioritized during Triage with Product Managersfeature requestimprovement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions