You are here

public function WebformExceptionHtmlSubscriber::onException in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/EventSubscriber/WebformExceptionHtmlSubscriber.php \Drupal\webform\EventSubscriber\WebformExceptionHtmlSubscriber::onException()

Handles errors for this subscriber.

Parameters

\Symfony\Component\HttpKernel\Event\ExceptionEvent $event: The event to process.

Overrides HttpExceptionSubscriberBase::onException

File

src/EventSubscriber/WebformExceptionHtmlSubscriber.php, line 263

Class

WebformExceptionHtmlSubscriber
Event subscriber to redirect to login form when webform settings instruct to.

Namespace

Drupal\webform\EventSubscriber

Code

public function onException(GetResponseForExceptionEvent $event) {

  // Only handle 403 exception.
  // @see \Drupal\webform\EventSubscriber\WebformExceptionHtmlSubscriber::on403
  $exception = $event
    ->getException();
  if ($exception instanceof HttpExceptionInterface && $exception
    ->getStatusCode() === 403) {
    parent::onException($event);
  }
}