Skip to content

Commit

Permalink
Bind Illuminate\Contracts\Debug\ExceptionHandler, possible solution for
Browse files Browse the repository at this point in the history
#74.

Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Jan 7, 2015
1 parent deb6bb8 commit 75017a6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Kernel extends \Illuminate\Foundation\Console\Kernel
*
* @param \Exception $e
* @return void
* @throws \Exception
*/
protected function reportException(Exception $e)
{
Expand Down
20 changes: 20 additions & 0 deletions src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php namespace Orchestra\Testbench\Exceptions;

use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
* @throws \Exception
*/
public function render($request, Exception $e)
{
throw $e;
}
}
1 change: 1 addition & 0 deletions src/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Kernel extends \Illuminate\Foundation\Http\Kernel
*
* @param \Exception $e
* @return void
* @throws \Exception
*/
protected function reportException(Exception $e)
{
Expand Down
12 changes: 12 additions & 0 deletions src/Traits/ApplicationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public function createApplication()
{
$app = $this->resolveApplication();

$this->resolveApplicationExceptionHandler($app);
$this->resolveApplicationCore($app);
$this->resolveApplicationConfiguration($app);
$this->resolveApplicationHttpKernel($app);
Expand Down Expand Up @@ -245,4 +246,15 @@ protected function resolveApplicationHttpKernel($app)
{
$app->singleton('Illuminate\Contracts\Http\Kernel', 'Orchestra\Testbench\Http\Kernel');
}

/**
* Resolve application HTTP exception handler.
*
* @param \Illuminate\Foundation\Application $app
* @return void
*/
protected function resolveApplicationExceptionHandler($app)
{
$app->singleton('Illuminate\Contracts\Debug\ExceptionHandler', 'Orchestra\Testbench\Exceptions\Handler');
}
}

0 comments on commit 75017a6

Please sign in to comment.