You are here

private function OAuthKeyForm::onException in Lightning API 8.4

Same name and namespace in other branches
  1. 8 src/Form/OAuthKeyForm.php \Drupal\lightning_api\Form\OAuthKeyForm::onException()
  2. 8.2 src/Form/OAuthKeyForm.php \Drupal\lightning_api\Form\OAuthKeyForm::onException()
  3. 8.3 src/Form/OAuthKeyForm.php \Drupal\lightning_api\Form\OAuthKeyForm::onException()

Handles exceptions caught during form submission.

Parameters

\Exception $e: The caught exception.

\Drupal\Core\Form\FormStateInterface $form_state: The current form state.

1 call to OAuthKeyForm::onException()
OAuthKeyForm::submitForm in src/Form/OAuthKeyForm.php
Form submission handler.

File

src/Form/OAuthKeyForm.php, line 74

Class

OAuthKeyForm
Provides a form for generating oAuth key pairs.

Namespace

Drupal\lightning_api\Form

Code

private function onException(\Exception $e, FormStateInterface $form_state) {
  $this
    ->messenger()
    ->addError($e
    ->getMessage());
  $form_state
    ->setRebuild();
}