Commit c1312999 authored by Taylor Otwell's avatar Taylor Otwell

fix conflicts

parents 350a0f18 395b69b5
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
namespace App\Exceptions; namespace App\Exceptions;
use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
...@@ -14,6 +17,7 @@ class Handler extends ExceptionHandler ...@@ -14,6 +17,7 @@ class Handler extends ExceptionHandler
*/ */
protected $dontReport = [ protected $dontReport = [
HttpException::class, HttpException::class,
ModelNotFoundException::class,
]; ];
/** /**
...@@ -38,6 +42,10 @@ class Handler extends ExceptionHandler ...@@ -38,6 +42,10 @@ class Handler extends ExceptionHandler
*/ */
public function render($request, $e) public function render($request, $e)
{ {
if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
}
return parent::render($request, $e); return parent::render($request, $e);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment