Any reason for not printing Exception Message in ObjectManager\Factory\AbstractFactory::createObject? #26550
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.