Magento2: Not understandable errors

Created on 16 Mar 2016  路  5Comments  路  Source: magento/magento2

Hello,

I found another problem that needs to be checked by developers, and it is concerning errors found in system.log.

I am facing this error now:

[2016-03-16 14:29:24] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_56f1b068ec7ccf4878f9284dd1137afd1: Please correct the XML data and try again. [] []

That says that there is an error in an XML somewhere, but it does not say which XML is the problem.

Now, due to urgency, I will need to debug Magento core in order to discover where exactly the error is, but for the sake of simplicity you may consider adding more useful information to that error.

This is not the first time I need to do something similar.

I had a similar issue with storing a customer address because a useless error was reported. I needed to "echo" the PHP Exception error exactly where it was produced, because the exception was reported as a very user friendly message, what is not useful to developers.

Regards
Jaime

Most helpful comment

I believe errors are still could be improved:

ex:
[2016-07-21 10:17:58] main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE0_36f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data and try again.

could be changed to:
[2016-07-21 10:17:58] main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE0_36f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data in file ../www/example.xml and try again.

That would remove the need to go through dozens of files that might be called this same and checking all of them.

All 5 comments

Hi @jaimestuardo

Your error was triggered here
https://github.com/magento/magento2/blob/develop/lib/internal/Magento/Framework/View/Model/Layout/Merge.php#L459

I created an internal ticket MAGETWO-50592 to make errors reporting more intuitive

Fix delivered to develop branch.
Closed.

I believe errors are still could be improved:

ex:
[2016-07-21 10:17:58] main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE0_36f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data and try again.

could be changed to:
[2016-07-21 10:17:58] main.INFO: Cache file with merged layout: LAYOUT_adminhtml_STORE0_36f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data in file ../www/example.xml and try again.

That would remove the need to go through dozens of files that might be called this same and checking all of them.

@maciekpaprocki i will ask it this can be done.

@maciekpaprocki it's a problem in most cases since validation is done on already merged file that no longer references the original files. We will add paths in places where it is possible.

Was this page helpful?
0 / 5 - 0 ratings