diff options
author | Camil Staps | 2016-01-22 12:01:33 +0100 |
---|---|---|
committer | Camil Staps | 2016-01-22 12:01:33 +0100 |
commit | 3a74377e861c1a401f1dffbd595f547e04eb72c8 (patch) | |
tree | 505649f58784ed0e318cb46f28777173bcdc6b90 /app/Exceptions/Handler.php |
Initial commitlumen-app
Diffstat (limited to 'app/Exceptions/Handler.php')
-rw-r--r-- | app/Exceptions/Handler.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php new file mode 100644 index 0000000..abb8a44 --- /dev/null +++ b/app/Exceptions/Handler.php @@ -0,0 +1,50 @@ +<?php + +namespace App\Exceptions; + +use Exception; +use Illuminate\Validation\ValidationException; +use Illuminate\Auth\Access\AuthorizationException; +use Illuminate\Database\Eloquent\ModelNotFoundException; +use Symfony\Component\HttpKernel\Exception\HttpException; +use Laravel\Lumen\Exceptions\Handler as ExceptionHandler; + +class Handler extends ExceptionHandler +{ + /** + * A list of the exception types that should not be reported. + * + * @var array + */ + protected $dontReport = [ + AuthorizationException::class, + HttpException::class, + ModelNotFoundException::class, + ValidationException::class, + ]; + + /** + * Report or log an exception. + * + * This is a great spot to send exceptions to Sentry, Bugsnag, etc. + * + * @param \Exception $e + * @return void + */ + public function report(Exception $e) + { + parent::report($e); + } + + /** + * Render an exception into an HTTP response. + * + * @param \Illuminate\Http\Request $request + * @param \Exception $e + * @return \Illuminate\Http\Response + */ + public function render($request, Exception $e) + { + return parent::render($request, $e); + } +} |