EnforcedFormResponseSubscriber::onKernelException

public EnforcedFormResponseSubscriber::onKernelException(GetResponseForExceptionEvent $event)

Replaces the response in case an EnforcedResponseException was thrown.

File

core/lib/Drupal/Core/EventSubscriber/EnforcedFormResponseSubscriber.php, line 20

Class

EnforcedFormResponseSubscriber
Handle the EnforcedResponseException and deliver an EnforcedResponse.

Namespace

Drupal\Core\EventSubscriber

Code

1
2
3
4
5
6
public function onKernelException(GetResponseForExceptionEvent $event) {
  if ($response = EnforcedResponse::createFromException($event->getException())) {
    // Setting the response stops the event propagation.
    $event->setResponse($response);
  }
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.