pull/42/head
aliqasemi 4 years ago
parent 34134508cc
commit fe8ccf163f

@ -7,7 +7,6 @@ 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;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
/** /**
@ -50,9 +49,10 @@ class Handler extends ExceptionHandler
public function render($request, Throwable $exception) public function render($request, Throwable $exception)
{ {
if ($exception instanceof ValidationErrorException) { if ($exception instanceof ValidationErrorException) {
return response()->json(Responser::error('تاریخ مورد نظر در زمان انتخابی رزرو شده است',[trans('common::messages.over_lap_date')]), 500); return response()->json(Responser::error($exception->getMessageBody(), $exception->getMessageInfo(), $exception->getMessage()), 422);
} }
return parent::render($request, $exception); return parent::render($request, $exception);
} }
} }
}
}

Loading…
Cancel
Save