From 9dd5d67fe9750d222618e31416168f8dd3a57aea Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Thu, 7 Sep 2023 08:32:13 -0400 Subject: [PATCH] Catch errors during service instaniation (#5749) --- src/Runtime/ServiceManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Runtime/ServiceManager.php b/src/Runtime/ServiceManager.php index 5893b11b20..29a401bc60 100644 --- a/src/Runtime/ServiceManager.php +++ b/src/Runtime/ServiceManager.php @@ -329,8 +329,8 @@ public function instantiateServices(array $bootstrapCommandClasses, DrushContain // "*AwareInterface" used by the handler $this->inflect($drushContainer, $commandHandler); $commandHandlers[] = $commandHandler; - } catch (\Exception $e) { - $this->logger->debug("Cound not instantiate {class}: {message}", ['class' => $class, 'message' => $e->getMessage()]); + } catch (\Throwable $e) { + $this->logger->debug("Could not instantiate {class}: {message}", ['class' => $class, 'message' => $e->getMessage()]); } }