Commit 474ae68e authored by Yas Naoi's avatar Yas Naoi Committed by Yas Naoi
Browse files

Issue #3121697 by yas: Fix an Internal Server Error: "Call to undefined method...

Issue #3121697 by yas: Fix an Internal Server Error: "Call to undefined method InvalidArgumentException::toString()"
parent 0b668b50
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ function cloud_update_8103() {
    }
    catch (\Exception $e) {
      // @TODO: Add error handling.
      \Drupal::messenger()->addError("An error occurred: {$e->toString()}");
      \Drupal::messenger()->addError("An error occurred: {$e->getMessage()}");
    }
  }

+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ function cloud_uninstall_service_provider($cloud_config) {
    }
  }
  catch (\Exception $e) {
    \Drupal::messenger()->addMessage($e->getMessage(), 'error');
    \Drupal::messenger()->addError($e->getMessage());
  }

  // Rebuild caches.
+7 −7
Original line number Diff line number Diff line
@@ -1561,7 +1561,7 @@ function aws_cloud_form_cloud_server_template_revision_delete_confirm_submit(arr
  }
  catch (\Exception $e) {
    // @TODO: Add error handling.
    \Drupal::messenger()->addError("An error occurred: {$e->toString()}");
    \Drupal::messenger()->addError("An error occurred: {$e->getMessage()}");
  }
}

@@ -1735,7 +1735,7 @@ function aws_cloud_get_launch_template_data(CloudServerTemplate $server_template
  }
  catch (\Exception $e) {
    // @TODO: Add error handling.
    \Drupal::messenger()->addError("An error occurred: {$e->toString()}");
    \Drupal::messenger()->addError("An error occurred: {$e->getMessage()}");
  }

  return $template_data;
@@ -2213,7 +2213,7 @@ function aws_cloud_form_cloud_config_aws_cloud_add_form_submit(array $form, Form
    batch_set($batch);
  }
  catch (\Exception $e) {
    \Drupal::messenger()->addMessage($e->getMessage(), 'error');
    \Drupal::messenger()->addError($e->getMessage());
  }

  $form_state->setRedirect('entity.cloud_config.collection', []);
@@ -2515,7 +2515,7 @@ function aws_cloud_form_cloud_config_aws_cloud_form_common_alter(array &$form, F
    }
    catch (\Exception $e) {
      // @TODO: Add error handling.
      \Drupal::messenger()->addError("An error occurred: {$e->toString()}");
      \Drupal::messenger()->addError("An error occurred: {$e->getMessage()}");
    }
  }

@@ -3032,7 +3032,7 @@ function aws_cloud_get_long_running_instances($criteria) {
  }
  catch (\Exception $e) {
    // @TODO: Add error handling.
    \Drupal::messenger()->addError("An error occurred: {$e->toString()}");
    \Drupal::messenger()->addError("An error occurred: {$e->getMessage()}");
  }
  return $instances;
}
@@ -3128,7 +3128,7 @@ function aws_cloud_get_stale_snapshots($cloud_context = '') {
    }
  }
  catch (\Exception $e) {
    \Drupal::messenger()->addError("An error occurred: {$e->toString()}");
    \Drupal::messenger()->addError("An error occurred: {$e->getMessage()}");
  }
  return $stale_snapshots;
}
@@ -3177,7 +3177,7 @@ function aws_cloud_get_unused_snapshots($cloud_context = '') {
    }
  }
  catch (\Exception $e) {
    \Drupal::messenger()->addError("An error occurred: {$e->toString()}");
    \Drupal::messenger()->addError("An error occurred: {$e->getMessage()}");
  }
  return $unused_snapshots;
}
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ class InstanceRebootMultipleForm extends AwsCloudProcessMultipleForm {
    }
    catch (\Exception $e) {
      // @TODO: Add error handling.
      $this->messenger->addError("An error occurred: {$e->toString()}");
      $this->messenger->addError("An error occurred: {$e->getMessage()}");
    }
  }

+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ class InstanceStartForm extends AwsDeleteForm {
      }
      catch (\Exception $e) {
        // @TODO: Add error handling.
        $this->messenger->addError("An error occurred: {$e->toString()}");
        $this->messenger->addError("An error occurred: {$e->getMessage()}");
      }
    }

Loading