public function WebformDefaultExceptionHtmlSubscriber::onException in Webform 6.x
Same name and namespace in other branches
- 8.5 src/EventSubscriber/WebformDefaultExceptionHtmlSubscriber.php \Drupal\webform\EventSubscriber\WebformDefaultExceptionHtmlSubscriber::onException()
Handles errors for this subscriber.
Parameters
\Symfony\Component\HttpKernel\Event\ExceptionEvent $event: The event to process.
Overrides HttpExceptionSubscriberBase::onException
File
- src/
EventSubscriber/ WebformDefaultExceptionHtmlSubscriber.php, line 263
Class
- WebformDefaultExceptionHtmlSubscriber
- Event subscriber to redirect to login form when webform settings instruct to.
Namespace
Drupal\webform\EventSubscriberCode
public function onException(ExceptionEvent $event) {
// Only handle 403 exception.
// @see \Drupal\webform\EventSubscriber\WebformExceptionHtmlSubscriber::on403
$exception = $event
->getThrowable();
if ($exception instanceof HttpExceptionInterface && $exception
->getStatusCode() === 403) {
parent::onException($event);
}
}