You are here

protected function FormAjaxSubscriber::getFormAjaxException in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php \Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber::getFormAjaxException()
  2. 10 core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php \Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber::getFormAjaxException()

Extracts a form AJAX exception.

Parameters

\Exception $e: A generic exception that might contain a form AJAX exception.

Return value

\Drupal\Core\Form\FormAjaxException|null Either the form AJAX exception, or NULL if none could be found.

1 call to FormAjaxSubscriber::getFormAjaxException()
FormAjaxSubscriber::onException in core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php
Catches a form AJAX exception and build a response from it.

File

core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php, line 133

Class

FormAjaxSubscriber
Wraps AJAX form submissions that are triggered via an exception.

Namespace

Drupal\Core\Form\EventSubscriber

Code

protected function getFormAjaxException(\Exception $e) {
  $exception = NULL;
  while ($e) {
    if ($e instanceof FormAjaxException) {
      $exception = $e;
      break;
    }
    $e = $e
      ->getPrevious();
  }
  return $exception;
}