From 4d572d4a05ad72dd8b26e5c7e5294c02e0c0b889 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Mon, 20 May 2024 11:05:53 +0100 Subject: [PATCH] chore: errors.php --- app/config/errors.php | 5 +++++ src/Executor/Executor.php | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/config/errors.php b/app/config/errors.php index 287e639f6b..ec37a2a34e 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -519,6 +519,11 @@ return [ 'description' => 'Entrypoint for your Appwrite Function is missing. Please specify it when making deployment or update the entrypoint under your function\'s "Settings" > "Configuration" > "Entrypoint".', 'code' => 404, ], + Exception::FUNCTION_SYNCHRONOUS_TIMEOUT => [ + 'name' => Exception::FUNCTION_SYNCHRONOUS_TIMEOUT, + 'description' => 'Synchronous function execution timed out. Please check the function code and try again.', + 'code' => 408, + ], /** Builds */ Exception::BUILD_NOT_FOUND => [ diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 170b6dc23a..26a8934aae 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -3,7 +3,6 @@ namespace Executor; use Appwrite\Extend\Exception as AppwriteException; -use Appwrite\Utopia\Response; use Exception; use Utopia\System\System; @@ -333,7 +332,7 @@ class Executor if ($curlError) { if ($curlError == CURLE_OPERATION_TIMEDOUT) { - throw new AppwriteException(AppwriteException::FUNCTION_SYNCHRONOUS_TIMEOUT, $curlErrorMessage, Response::STATUS_CODE_REQUEST_TIMEOUT); + throw new AppwriteException(AppwriteException::FUNCTION_SYNCHRONOUS_TIMEOUT); } throw new Exception($curlErrorMessage . ' with status code ' . $responseStatus, $responseStatus); }