handling error 500

This commit is contained in:
Thibault Richy 2019-02-28 09:28:24 +01:00
parent 1586415ea8
commit 2e94482d5e
2 changed files with 28 additions and 0 deletions

View file

@ -46,6 +46,11 @@ class Handler extends ExceptionHandler
*/
public function render($request, Exception $exception)
{
if ($exception instanceof \ErrorException) {
$response = response()->view('errors.500', [], 500);
return $this->toIlluminateResponse($response,$exception);
}
return parent::render($request, $exception);
}
}

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="{{ asset('css/jquery.fancybox.min.css') }}" rel="stylesheet">
</head>
<body class="code404">
<div>
<h2>Erreur 500</h2>
<p>Une erreur est survenue, Merci de réessayer ultérieurement.</p>
</div>
</body>
</html>