/**
  * {@inheritdoc}
  */
 public function validateForm(array &$form, FormStateInterface $form_state)
 {
     $storage = $form_state->getStorage();
     if (!isset($storage['choose'])) {
         try {
             $response = $this->client->getSubscriptionCredentials($form_state->getValue('email'), $form_state->getValue('pass'));
         } catch (ConnectorException $e) {
             // Set form error to prevent switching to the next page.
             if ($e->isCustomized()) {
                 $form_state->setErrorByName('', $e->getCustomMessage());
             } else {
                 \Drupal::logger('acquia connector')->error($e->getMessage());
                 $form_state->setErrorByName('', $this->t('Can\'t connect to the Acquia Subscription.'));
             }
         }
         if (!empty($response)) {
             $storage['response'] = $response;
         }
     }
     $form_state->setStorage($storage);
 }