Attendize/app/Exceptions/Handler.php

53 lines
1.3 KiB
PHP
Raw Normal View History

2016-02-29 15:59:36 +00:00
<?php
namespace App\Exceptions;
2016-03-05 00:18:10 +00:00
use Exception;
2016-03-30 00:30:02 +00:00
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
2016-02-29 15:59:36 +00:00
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
2016-09-06 20:39:27 +00:00
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\HttpException;
2016-02-29 15:59:36 +00:00
2016-03-05 00:18:10 +00:00
//use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
2016-02-29 15:59:36 +00:00
2016-03-05 00:18:10 +00:00
class Handler extends ExceptionHandler
{
2016-02-29 15:59:36 +00:00
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
2016-03-30 00:30:02 +00:00
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
2016-02-29 15:59:36 +00:00
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
2016-09-06 20:39:27 +00:00
* @param \Exception $e
2016-02-29 15:59:36 +00:00
* @return void
*/
2016-03-05 00:18:10 +00:00
public function report(Exception $e)
{
2016-03-30 00:30:02 +00:00
parent::report($e);
2016-02-29 15:59:36 +00:00
}
/**
* Render an exception into an HTTP response.
*
2016-09-06 20:39:27 +00:00
* @param \Illuminate\Http\Request $request
* @param \Exception $e
2016-02-29 15:59:36 +00:00
* @return \Illuminate\Http\Response
*/
2016-03-05 00:18:10 +00:00
public function render($request, Exception $e)
{
2016-02-29 15:59:36 +00:00
return parent::render($request, $e);
}
}