Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Whoops pages stopped displaying for errors in some pages #162

Closed
goharsahi opened this Issue Feb 23, 2014 · 14 comments

Comments

Projects
None yet
3 participants

I'm using Laravel 4.1 and Whoops pages were working perfectly for me, when all of a sudden, it stopped displaying errors in certain pages in the middle of programming, however, for some pages, it still shows errors, e.g. if I make a deliberate mistake in app.php, routes.php, views.php etc... it does show whoops page, however, certain other pages like, filters.php, config/auth.php, contollers/, views/, models and most others, it stopped displaying errors. Just shows white screen.

However, it is logging all the errors in laravel.log file along will whole stack trace and time etc. This has happened to me second time. Any guess?

Collaborator

denis-sokolov commented Feb 23, 2014

To begin with, could you let me know the version of Whoops you are using?

I don't know how to check the version. I just installed Laravel 4.1 a week back.

Collaborator

denis-sokolov commented Feb 23, 2014

That's okay. It means you are using Whoops 1.0.10.
There are no known issues that resemble anything like you tell.

If you would be willing to debug this, I could guide you on what to do.
To begin with, it seems that the Whoops is not being registered as a handler at some point in the runtime of your application. Could you play search around, see if anything in your application does anything with set_error_handler or restore_error_handler?

your help is much appreciated. I'll look around. In the meanwhile, I've pasted the stack trace of last error, not displayed by whoops. http://laravel.io/bin/Y2V6

where can I find set_error_handler? I'm just a couple of months into frameworks as such.

ok, found quite a few instances of set_error_handler

E:\My Data\htdocs\laravel4\compliance\vendor\filp\whoops\src\Whoops\Run.php:
110 class_exists("\Whoops\Exception\Inspector");
111
112: set_error_handler(array($this, self::ERROR_HANDLER));

To give you further insight, this is precisely what I was coding when the whoops pages first disappeared.

http://laravel.io/bin/mWxq

Wonder anything wrong I did here thats a no no in laravel 4.

Collaborator

denis-sokolov commented Feb 23, 2014

I'm sorry, after reviewing everything, I'm no closer to the solution.
I am afraid this is something misconfigured in your project and you'll have to solve it on your own, unless you manage to provide exact steps to reproduce the problem on a fresh installation of Laravel. :(

Ok, I'll try to do that and get back to you. Thanks for your time and help.

i've finally traced the issue. I had following code in my routes.php.

App::error(function(NotFoundHttpException $e)
{
    return View::make('Not Found', 404);
});
Collaborator

denis-sokolov commented Feb 24, 2014

Ah, so you have installed your own error handler, I see.
I am glad that you have found the issue!

Contributor

Anahkiasen commented Feb 24, 2014

Well that makes sense no, if you catch the Exception, then there's no reason for Whoops to trigger is there ?

Actually, like I mentioned, I'm still new to Laravel. And I didn't know how whoops operates. Thats one step up the learning curve though.

Another thing I found though. I've got this code in app/start/global.php

App::error(function(Exception $exception, $code)
{
    Log::error($exception);
});

And then I have this another piece in my routes.php

App::error(function(Exception $e)
{
    Log::error($e);
});

Isn't this redundancy?

Collaborator

denis-sokolov commented Feb 24, 2014

I think you should really seek some help on Laravel about this.

ok, thanks alot for your help and time. .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment