Commit bb728dd6 authored by Victor Friboulet's avatar Victor Friboulet
Browse files

feat: trigger exception handler

parent 9efcf680
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace App\Exceptions;

use Illuminate\Database\QueryException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
@@ -37,6 +38,10 @@ class Handler extends ExceptionHandler
     */
    public function register()
    {
        $this->renderable(function(QueryException $queryException, Request $request){
            if ($queryException->getCode()==45000)
            return response()->view('erreur-page',['error'=>$queryException->getMessage()]);
        });
        $this->reportable(function (Throwable $e) {
            //
        });