Permalink
Browse files

Work on Whoops.

  • Loading branch information...
taylorotwell committed Jun 11, 2014
1 parent 3380b1b commit c2c35891b0a74bbf844b234752adee64c38fc224
Showing with 3 additions and 34 deletions.
  1. +3 −34 src/Illuminate/Exception/ExceptionServiceProvider.php
@@ -4,7 +4,6 @@
use Whoops\Handler\PrettyPageHandler;
use Whoops\Handler\JsonResponseHandler;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\Debug\ExceptionHandler as SymfonyExceptionHandler;
class ExceptionServiceProvider extends ServiceProvider {
@@ -63,7 +62,7 @@ protected function registerPlainDisplayer()
}
else
{
return new SymfonyDisplayer(new SymfonyExceptionHandler(false));
return new PlainDisplayer;
}
});
}
@@ -79,7 +78,7 @@ protected function registerDebugDisplayer()
$this->app['exception.debug'] = $this->app->share(function($app)
{
return new SymfonyDisplayer(new SymfonyExceptionHandler, $this->shouldReturnJson());
return new WhoopsDisplayer($app['whoops'], $app->runningInConsole());
});
}
@@ -156,38 +155,8 @@ protected function registerPrettyWhoopsHandler()
{
with($handler = new PrettyPageHandler)->setEditor('sublime');
// If the resource path exists, we will register the resource path with Whoops
// so our custom Laravel branded exception pages will be used when they are
// displayed back to the developer. Otherwise, the default pages are run.
if ( ! is_null($path = $this->resourcePath()))
{
$handler->addResourcePath($path);
}
return $handler;
});
}
/**
* Get the resource path for Whoops.
*
* @return string
*/
public function resourcePath()
{
if (is_dir($path = $this->getResourcePath())) return $path;
}
/**
* Get the Whoops custom resource path.
*
* @return string
*/
protected function getResourcePath()
{
$base = $this->app['path.base'];
return $base.'/vendor/laravel/framework/src/Illuminate/Exception/resources';
}
}
}

0 comments on commit c2c3589

Please sign in to comment.