Skip to content

Commit

Permalink
Add an empty error bag for HTTP exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
webchopin committed Feb 12, 2018
1 parent 29c7deb commit 8dce475
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Illuminate/Foundation/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Illuminate\Routing\Router;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\ViewErrorBag;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Http\RedirectResponse;
use Whoops\Handler\PrettyPageHandler;
Expand Down Expand Up @@ -400,7 +401,7 @@ protected function renderHttpException(HttpException $e)
})->push(__DIR__.'/views')->all());

if (view()->exists($view = "errors::{$status}")) {
return response()->view($view, ['exception' => $e], $status, $e->getHeaders());
return response()->view($view, ['exception' => $e, 'errors' => new ViewErrorBag], $status, $e->getHeaders());
}

return $this->convertExceptionToResponse($e);
Expand Down

0 comments on commit 8dce475

Please sign in to comment.