From c083e1ce741d7200dc51d24d4184cbdb63cae783 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 15 Jan 2026 16:31:37 +1300 Subject: [PATCH 1/2] Throw AppwriteException so handler can unwrap --- src/Appwrite/Platform/Workers/Functions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Functions.php b/src/Appwrite/Platform/Workers/Functions.php index d047d0925e..fbf996319c 100644 --- a/src/Appwrite/Platform/Workers/Functions.php +++ b/src/Appwrite/Platform/Workers/Functions.php @@ -9,6 +9,7 @@ use Appwrite\Event\Realtime; use Appwrite\Event\StatsUsage; use Appwrite\Event\Webhook; use Appwrite\Utopia\Response\Model\Execution; +use Appwrite\Extend\Exception as AppwriteException; use Exception; use Executor\Executor; use Utopia\CLI\Console; @@ -661,7 +662,11 @@ class Functions extends Action ->trigger(); if (!empty($error)) { - throw new Exception($error, $errorCode); + throw new AppwriteException( + AppwriteException::GENERAL_SERVER_ERROR, + $error ?: 'Function execution failed with no error message', + $errorCode + ); } } } From 7ab3debb10c74e2898c79fdcfb4808f2fabf82ab Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 15 Jan 2026 16:37:09 +1300 Subject: [PATCH 2/2] Format --- src/Appwrite/Platform/Workers/Functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Functions.php b/src/Appwrite/Platform/Workers/Functions.php index fbf996319c..e053efa021 100644 --- a/src/Appwrite/Platform/Workers/Functions.php +++ b/src/Appwrite/Platform/Workers/Functions.php @@ -8,8 +8,8 @@ use Appwrite\Event\Func; use Appwrite\Event\Realtime; use Appwrite\Event\StatsUsage; use Appwrite\Event\Webhook; -use Appwrite\Utopia\Response\Model\Execution; use Appwrite\Extend\Exception as AppwriteException; +use Appwrite\Utopia\Response\Model\Execution; use Exception; use Executor\Executor; use Utopia\CLI\Console;