From 807b79e422dd9e8434bc38cc1dc49faf45fd42bb Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Wed, 13 Mar 2024 13:36:20 -0700 Subject: [PATCH] CLI-1292: Catch Cloud API type errors --- src/EventListener/ExceptionListener.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/EventListener/ExceptionListener.php b/src/EventListener/ExceptionListener.php index 9a6ffdd7d..53e3216da 100644 --- a/src/EventListener/ExceptionListener.php +++ b/src/EventListener/ExceptionListener.php @@ -79,6 +79,10 @@ public function onConsoleError(ConsoleErrorEvent $event): void { } } + if ($error instanceof \TypeError && str_contains($error->getMessage(), 'AcquiaCloudApi\Response')) { + $newErrorMessage = 'Cloud API returned an unexpected data type; this could indicate a problem with your Cloud application.'; + } + $this->helpMessages[] = "You can find Acquia CLI documentation at https://docs.acquia.com/acquia-cli/"; $this->writeUpdateHelp($event); $this->writeSupportTicketHelp($event);