-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add line and file to the exception message when debug is ON #11675
Conversation
When debug parameter is ON, a lot get displayed, besides the recently added backtrace, |
Yes i had similar thoughts ... but before anything, we could agree that it is ok if this get displayed when debug parameter is ON:
|
i see no problem with that.
IMO no production website should ever be with debug set to ON in global config or/and the system debug plugin enabled. |
The backtrace that's rendered here comes from the Throwable object, which On Friday, August 19, 2016, andrepereiradasilva notifications@github.com
|
ok, so this, you say this should not be modified to include it :? What about (1) adding it the way this PR suggests:
and (2) what about changing method signature (so that we can render trace in reverse):
to
|
I wouldn't add it to the render method right now. Personally I'd go for On Friday, August 19, 2016, Georgios Papadakis notifications@github.com
|
@ggppdk Where are we at with this - is it on hold? This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11675. |
Well noone objected for adding this file and line of the error when DEBUG is ON, there was a concern for doing it in more proper place, so i think we are good to test it |
So, I ran into this today and even opened an issue as you can see. Can you update the branch to fix the merge conflict? Then we should test this. :-) |
To clarify: I'd rather implement this the way it is proposed here, than to have the broken display that we have right now. If there is a better solution, we can still implement that in 4.0. |
The changes to the error.php files do work, but unfortunately another change crept into this PR. Can you fix that and also again merge in the staging branch? |
PR updated |
</p> | ||
<?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, 'UTF-8'); ?> | ||
<?php if ($this->debug) : ?> | ||
<br/><?php echo htmlspecialchars($this->error->getFile(), ENT_QUOTES, 'UTF-8');?>:<?php echo $this->error->getLine(); ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change <br/>
to <br>
.
You may want to change to this for better readability:
<?php echo htmlspecialchars($this->error->getFile(), ENT_QUOTES, 'UTF-8') . ':' . $this->error->getLine(); ?>
Can you add this code to the other error.php files in the frontend, too? |
PR updated to add these changes to the error.php of the frontend templates |
I have tested this item ✅ successfully on 4d54887 Operating System
Steps
Test before patchTest after patch
Tested @icampus This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/11675. |
@lavipr please mark your Test at Issue Tracker. If this is not possible, i can alter Test. |
I have tested this item ✅ successfully on 4d54887 Steps: enable debug mode Tested @icampus This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/11675. |
RTC after two successful tests. |
I have tested this item ✅ successfully on 4d54887 Tested @icampus This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/11675. |
@Crometor thanks for Test this Pull Request. As it has 2 successfully Tests, it wasn't necessary for this PR for 3rd Test :-) |
Pull Request for Issue #10732
Summary of Changes
This PR adds the last file and line,
of the file at which the error was thrown
when debug is ON
A backtrace without it was added by this PR (when debug is ON)
#10964
Testing Instructions
Cause an exception to be thrown at a file
The file and line, should show up in the error message (when debug is ON)
Documentation Changes Required