1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-11-30 11:56:54 +00:00
not-gwent-online/site/server/app/Exceptions/Handler.php

52 lines
1.1 KiB
PHP
Raw Normal View History

2015-06-19 16:50:05 +00:00
<?php
2015-06-21 11:09:29 +00:00
namespace Gwent\Exceptions;
2015-06-19 16:50:05 +00:00
2015-06-21 11:09:29 +00:00
use Exception;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
2015-06-21 15:14:53 +00:00
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
2015-06-21 11:09:29 +00:00
class Handler extends ExceptionHandler {
2015-06-19 16:50:05 +00:00
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
2015-06-21 11:09:29 +00:00
HttpException::class,
2015-06-19 16:50:05 +00:00
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
2015-06-21 11:09:29 +00:00
* @param \Exception $e
*
2015-06-19 16:50:05 +00:00
* @return void
*/
public function report(Exception $e)
{
2015-06-21 11:09:29 +00:00
return parent::report($e);
2015-06-19 16:50:05 +00:00
}
/**
* Render an exception into an HTTP response.
*
2015-06-21 11:09:29 +00:00
* @param \Illuminate\Http\Request $request
* @param \Exception $e
*
2015-06-19 16:50:05 +00:00
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
2015-06-21 11:09:29 +00:00
if($e instanceof NotFoundHttpException) {
2015-06-21 14:34:27 +00:00
return redirect('/');
2015-06-21 11:09:29 +00:00
}
return parent::render($request, $e);
2015-06-19 16:50:05 +00:00
}
2015-06-21 11:09:29 +00:00
}