From 845ff52911eb9ce01e7ca000ca6dc1002289831e Mon Sep 17 00:00:00 2001 From: ChiragAgg5k Date: Tue, 15 Apr 2025 11:05:38 +0530 Subject: [PATCH] chore: update run method to catch throwable --- src/CLI/CLI.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CLI/CLI.php b/src/CLI/CLI.php index a1a2b14..ec10348 100644 --- a/src/CLI/CLI.php +++ b/src/CLI/CLI.php @@ -3,6 +3,7 @@ namespace Utopia\CLI; use Exception; +use Throwable; use Utopia\Hook; use Utopia\Validator; @@ -325,7 +326,7 @@ public function run(): self } else { throw new Exception('No command found'); } - } catch (Exception $e) { + } catch (Throwable $e) { foreach ($this->errors as $hook) { self::setResource('error', fn () => $e); \call_user_func_array($hook->getAction(), $this->getParams($hook));