-
-
Notifications
You must be signed in to change notification settings - Fork 605
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
Stack trace on syntax error #47
Comments
I believe this might be related to #47, and will have to be addressed. I'll focus on this very very soon. Thanks for the report! 😄 |
I'm having some trouble reproducing this one locally; can you provide (if you still have it) the code you were using to cause this issue, and your PHP version? Cheers! |
PHP Version: It appears the bug appears only with the {"error":{"type":"Whoops\\Exception\\ErrorException","message":"syntax error, unexpected '}'","file":"\/home\/rkip\/sites\/whoops\/public\/syntax-error.php","line":3}} While the |
I'm having the same issue, running PHP 5.3.3-7+squeeze14. The issue seems to be related to the following line. if(false && this->exception instanceof ErrorException && empty($frames[1]['line'])) { but I assume that will probably break something else. |
To clarify things, this happens with any kind of error, e.g. while trying to access a protected property. |
I was to able to fix it by specifying a new method See attached. The line however is still reported incorrectly... I suppose further adjustments are needed. @filp please have a look and I can send a Pull request if this looks good. |
Fix confirmed at my end. Thanks a lot! |
How come there's no "real" stack trace from trapping an |
@mindplay-dk, I am unable to reproduce your problem, I have a full stack. |
I'm using the last tagged release 1.0.10 with PHP 5.3.8 under Windows.
Might give the |
Also try and see if there's anything wrong with your PHP, see if the following outputs a correct traceback: function foo(){
throw new \ErrorException();
}
try {
foo();
} catch (\Exception $e) {
echo $e->getTraceAsString();
} |
Yep, this no longer occurs with |
When a syntax error occurs, an
ErrorException
is generated from the shutdown handler. This appears to create an invalid stack trace, as you can see in the image below. Am I doing something wrong or should this issue be addressed?To circumvent this issue in my application I've temporarily added the option to let
ErrorException
generate a custom stack trace from itsgetLine()
andgetFile()
methods.The text was updated successfully, but these errors were encountered: