diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 5464014b48..f872ef311b 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 d48787bb98..5824e0ffd8 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;