Skip to content
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

Integration with Xdebug to improve error handler #34

Closed
ejunker opened this issue Apr 15, 2013 · 4 comments
Closed

Integration with Xdebug to improve error handler #34

ejunker opened this issue Apr 15, 2013 · 4 comments
Milestone

Comments

@ejunker
Copy link

ejunker commented Apr 15, 2013

It seems whoops is focusing more on exception handling than error handling. I am currently using Xdebug and the HTML stacktraces. http://xdebug.org/docs/stack_trace I'm wondering if the whoops error handler could be improved by integrating with Xdebug.

For example, using this example code:

<?php
require __DIR__ . '/vendor/autoload.php';

$run = new Whoops\Run;
$handler = new Whoops\Handler\PrettyPageHandler;
$run->pushHandler($handler);
$run->register();

bar();

Whoops doesn't show me the line number where the error occurred or a stacktrace. If I use xdebug's error messages I do get line numbers and a stacktrace.

Edit: After looking into it, you can get the backtrace without using Xdebug. I made some progress by adding this code to getFrames() in Inspector.php

if ($this->exception instanceof ErrorException) {
    $frames = debug_backtrace();
}
@stijnj
Copy link

stijnj commented Jun 14, 2013

+1 on this. Would really improve error handling.

An other option is to improve extensibility of Inspector by adding a protected setter for frames attribute so we're allowed to set our own frames from Xdebug.

@Rarst
Copy link
Contributor

Rarst commented Aug 13, 2013

+1 some frameworks are error- rather than exception-centric (*cough* WordPress) and it would be very nice to have backtrace for errors (even native PHP one for starters, without xdebug extras).

update hm, I got first impression it's not showing backtraces for errors in general, but sometimes it does and sometimes it doesn't.

@denis-sokolov
Copy link
Collaborator

Also xdebug has potentially powerful features, such as collect_params.

@denis-sokolov
Copy link
Collaborator

We do not get a backtrace for PHP fatal errors, this is a PHP limitation.

Using Xdebug would allow us to workaround this limitation, as well as use other features, as the mentioned collect_params.

I have added this feature request on our list of possible features to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants