? ? Success

User tests: Successful: Unsuccessful:

avatar mbabker
mbabker
29 Jun 2016

Summary of Changes

An Exception may have been chained to include additional errors. If this is the case, the chained errors may help with debugging an issue. So when in debug mode, I suggest that our error templates display the error data for all Exceptions.

Testing Instructions

Enable debug mode.

You'll be testing each core template, in both the site and admin apps, and you'll also want to test the system templates (default error pages), to do that you'll need to temporarily rename the error.php file in your active template to something else. Remember to give it back its original name when finished testing this.

Trigger the error page with a chained Exception (when creating an Exception object, pass the "previous" Exception as the third constructor argument). The previous Exception(s) should display when in debug mode with their stack trace after the main error is rendered.

avatar mbabker mbabker - open - 29 Jun 2016
avatar mbabker mbabker - change - 29 Jun 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 Jun 2016
Labels Added: ? ?
avatar brianteeman brianteeman - change - 29 Jun 2016
Category Language & Strings Templates (site)
avatar brianteeman brianteeman - change - 29 Jun 2016
Labels
avatar ggppdk
ggppdk - comment - 29 Jun 2016

Trigger the error page with a chained Exception (when creating an Exception object, pass the "previous" Exception as the third constructor argument).

Can you make this testing step to be more detailed, e.g. provide an example of file/line to change to trigger such an error, i don't understand it

avatar mbabker
mbabker - comment - 29 Jun 2016
throw new Exception('Top Exception', 500, new Exception('Nested Exception'));
avatar yvesh
yvesh - comment - 29 Jun 2016

For me it does not output the "Nested Exception" message, but two times the parent one (Top Exception in your example).

screenshot 2016-06-29 21 02 24

avatar mbabker mbabker - change - 29 Jun 2016
The description was changed
avatar mbabker
mbabker - comment - 29 Jun 2016

I left all these comments about using $this->_error versus $this->error and I still managed to screw that up. It's fixed now.

avatar yvesh
yvesh - comment - 29 Jun 2016

Yep working now. Imo it's a nice improvement, there are some valid use cases for nested exceptions ?

avatar ggppdk
ggppdk - comment - 29 Jun 2016

Yes, it shows both correctly,

not relevant to this topic, i hope something is decided for getFile() getLine() too that will show the line that the exception occured, thanks

avatar mbabker mbabker - change - 13 Aug 2016
Title
[RFC] Render all exceptions on error page when in debug mode
Render all exceptions on error page when in debug mode
avatar mbabker mbabker - change - 13 Aug 2016
The description was changed
avatar mbabker mbabker - change - 13 Aug 2016
The description was changed
avatar mbabker
mbabker - comment - 13 Aug 2016

No longer RFC, changes made to all core templates, please test.

avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Aug 2016

@mbabker the test went well. But one thing is missing. I tested in admin templates (isis, hathor and system) and i get a JERROR_LAYOUT_PREVIOUS_ERROR not translated.

image

So i think you need to add that language var also to https://github.com/joomla/joomla-cms/blob/staging/administrator/language/en-GB/en-GB.ini

avatar andrepereiradasilva andrepereiradasilva - test_item - 15 Aug 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 15 Aug 2016

I have tested this item successfully on b9bfda1


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10964.

avatar yvesh
yvesh - comment - 15 Aug 2016

@mbabker How about moving generating that output to a helper / JLayout file - so much duplicate code? :(

JHtmlError for example

avatar mbabker
mbabker - comment - 15 Aug 2016

It's appropriate in the template. Otherwise there will have to be additional public APIs to do the same. Plus, there should be zero output generated by helper methods, meaning the helper method would have to call JLayout, and now to override markup that was originally created in the template (either directly or through a method called by the template) you have to override a layout file. This is the cleanest approach.

avatar yvesh yvesh - test_item - 16 Aug 2016 - Tested successfully
avatar yvesh
yvesh - comment - 16 Aug 2016

I have tested this item successfully on b9bfda1

Thank you for the explanation


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10964.

avatar jeckodevelopment jeckodevelopment - change - 17 Aug 2016
Status Pending Ready to Commit
Labels
avatar jeckodevelopment
jeckodevelopment - comment - 17 Aug 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10964.

avatar joomla-cms-bot joomla-cms-bot - change - 17 Aug 2016
Labels Added: ?
avatar rdeutz rdeutz - change - 19 Aug 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-08-19 17:50:19
Closed_By rdeutz
avatar brianteeman brianteeman - change - 20 Aug 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment