1

I'm using laravel 4, and loving it so far - but i'm trying to create a custom error handler.

The default error handler is:

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

Now I would like be able to get the line number, the file, and the error of which the error is occurring in, the problem is everything in $exception seems to be private - and doing a var_dump of it seems to crash my browser as it's so long.

Any help would be great.

4

1 回答 1

3

这对我来说很好用:

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

   echo "<pre>";
   var_dump( $exception->getTrace() );
   echo "</pre>";

});

请试一试。

于 2013-10-23T14:10:33.600 回答