Giter Club home page Giter Club logo

Comments (13)

filp avatar filp commented on May 18, 2024

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! 😄

from whoops.

filp avatar filp commented on May 18, 2024

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!

from whoops.

rjkip avatar rjkip commented on May 18, 2024

PHP Version: 5.4.5-1~dotdeb.0
Code to reproduce: https://gist.github.com/rjkip/fa4cfbfbb5fbf5927d75

It appears the bug appears only with the PrettyPageHandler. The JsonResponseHandler outputs this:

{"error":{"type":"Whoops\\Exception\\ErrorException","message":"syntax error, unexpected '}'","file":"\/home\/rkip\/sites\/whoops\/public\/syntax-error.php","line":3}}

While the PrettyPageHandler shows this:

image

from whoops.

torjusb avatar torjusb commented on May 18, 2024

I'm having the same issue, running PHP 5.3.3-7+squeeze14.

The issue seems to be related to the following line.
If I were to change the line to the following, it seems to work:

if(false && this->exception instanceof ErrorException && empty($frames[1]['line'])) {

but I assume that will probably break something else.

from whoops.

rjkip avatar rjkip commented on May 18, 2024

To clarify things, this happens with any kind of error, e.g. while trying to access a protected property.

from whoops.

softius avatar softius commented on May 18, 2024

I was to able to fix it by specifying a new method getFrameFromError in Inspector tailored to ErrorException.

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.

errorexception

from whoops.

filp avatar filp commented on May 18, 2024

Merged #56, could you guys, if at all possible, verify if it fixes the situation for your specific scenarios? Hopefully it should be a clean fix, but it may need some further adjustments.

Thanks a ton, @softius, and everyone else who helped 😄

from whoops.

rjkip avatar rjkip commented on May 18, 2024

Fix confirmed at my end. Thanks a lot!

from whoops.

mindplay-dk avatar mindplay-dk commented on May 18, 2024

How come there's no "real" stack trace from trapping an ErrorException? I'm having to disable the error-hander temporarily to find out where an error is occurring...

from whoops.

denis-sokolov avatar denis-sokolov commented on May 18, 2024

@mindplay-dk, I am unable to reproduce your problem, I have a full stack.
What's your Whoops version, what particular error are you trying to trap?
Try with the latest (master) branch of Whoops as well.
Set "filp/whoops": "@dev" in your composer.json file for that.

from whoops.

mindplay-dk avatar mindplay-dk commented on May 18, 2024

I'm using the last tagged release 1.0.10 with PHP 5.3.8 under Windows.

ErrorException never has a stack trace, at least I've never seen one yet - it doesn't matter which type of warning or notice was trapped.

Might give the master a try tomorrow...

from whoops.

denis-sokolov avatar denis-sokolov commented on May 18, 2024

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();
}

from whoops.

mindplay-dk avatar mindplay-dk commented on May 18, 2024

Yep, this no longer occurs with master.

from whoops.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.