Update 'app/Exceptions/Handler.php'

pull/136/head
azizi 3 years ago
parent 766b63e61f
commit 8213e289a7

@ -6,6 +6,8 @@ use Throwable;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use WM\Core\Exceptions\ValidationErrorException; use WM\Core\Exceptions\ValidationErrorException;
use WM\Core\Services\Responser; use WM\Core\Services\Responser;
use WM\WebBuilder\Exceptions\SiteBannedException;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
@ -54,7 +56,10 @@ class Handler extends ExceptionHandler
{ {
if ($exception instanceof ValidationErrorException) { if ($exception instanceof ValidationErrorException) {
return response()->json(Responser::error($exception->getMessageBody(), $exception->getMessageInfo()), 422); 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); return parent::render($request, $exception);
} }
} }

Loading…
Cancel
Save