From 8213e289a7bc45f9c3759564f8db098b02637db8 Mon Sep 17 00:00:00 2001 From: azizi Date: Mon, 25 Oct 2021 16:42:49 +0000 Subject: [PATCH] Update 'app/Exceptions/Handler.php' --- app/Exceptions/Handler.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index a464486..7c471e8 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -6,6 +6,8 @@ use Throwable; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use WM\Core\Exceptions\ValidationErrorException; use WM\Core\Services\Responser; +use WM\WebBuilder\Exceptions\SiteBannedException; + class Handler extends ExceptionHandler { @@ -54,7 +56,10 @@ class Handler extends ExceptionHandler { if ($exception instanceof ValidationErrorException) { return response()->json(Responser::error($exception->getMessageBody(), $exception->getMessageInfo()), 422); + } elseif ($exception instanceof SiteBannedException) { + return response()->view('webBuilder::errors.template_disabled', ['error' => 'business banned']); } + return parent::render($request, $exception); } }