From 8dd883a3124d58c3ca5597c9ffa6ca71ec49bdb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 24 May 2024 13:04:30 +0200 Subject: [PATCH] Add comments --- app/controllers/api/projects.php | 2 ++ src/Appwrite/Extend/Exception.php | 1 + 2 files changed, 3 insertions(+) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 5464014b4..f872ef311 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -279,6 +279,8 @@ App::post('/v1/projects') } } + // Hook allowing instant project mirroring during migration + // Outside of migration, hook is not registered and has no effect $hooks->trigger('afterProjectCreation', [ $project, $pools, $cache ]); $response diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index d48787bb9..5824e0ffd 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -307,6 +307,7 @@ class Exception extends \Exception $this->type = $type; $this->code = $code ?? $this->errors[$type]['code']; + // Mark string errors like HY001 from PDO as 500 errors if(\is_string($this->code)) { if (\is_numeric($this->code)) { $this->code = (int) $this->code;