public ExceptionJsonSubscriber::on403(GetResponseForExceptionEvent $event)
Handles a 403 error for JSON.
Parameters
\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event: The event to process.
File
- core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php, line 47
Class
- ExceptionJsonSubscriber
- Default handling for JSON errors.
Namespace
Drupal\Core\EventSubscriber
Code
public function on403(GetResponseForExceptionEvent $event) { $response = new JsonResponse(array('message' => $event->getException()->getMessage()), Response::HTTP_FORBIDDEN); $event->setResponse($response); }
Please login to continue.