From 31a903d1440c50189247f7e29fc2f7d2030b1e4b Mon Sep 17 00:00:00 2001 From: Bhaskar Singh Date: Fri, 10 Mar 2023 00:24:33 +0530 Subject: [PATCH] Updated the error message for target check fails in custom domain creation --- app/config/errors.php | 10 +++++----- app/controllers/api/projects.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/config/errors.php b/app/config/errors.php index a682882d2e..ef131896fd 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -534,11 +534,6 @@ return [ 'description' => 'A Domain with the requested ID already exists.', 'code' => 409, ], - Exception::DOMAIN_VERIFICATION_FAILED => [ - 'name' => Exception::DOMAIN_VARIABLE_INCORRECT, - 'description' => 'Your Appwrite instance is not publicly accessible. Please check the _APP_DOMAIN_TARGET environment variable of your Appwrite server.', - 'code' => 501, - ], Exception::VARIABLE_NOT_FOUND => [ 'name' => Exception::VARIABLE_NOT_FOUND, 'description' => 'Variable with the requested ID could not be found.', @@ -554,6 +549,11 @@ return [ 'description' => 'Domain verification for the requested domain has failed.', 'code' => 401, ], + Exception::DOMAIN_VARIABLE_INCORRECT => [ + 'name' => Exception::DOMAIN_VARIABLE_INCORRECT, + 'description' => 'Your Appwrite instance is not publicly accessible. Please check the _APP_DOMAIN_TARGET environment variable of your Appwrite server.', + 'code' => 501, + ], Exception::GRAPHQL_NO_QUERY => [ 'name' => Exception::GRAPHQL_NO_QUERY, 'description' => 'Param "query" is not optional.', diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index d9c556b462..bc57cf04ac 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1340,7 +1340,7 @@ App::post('/v1/projects/:projectId/domains') $target = new Domain(App::getEnv('_APP_DOMAIN_TARGET', '')); if (!$target->isKnown() || $target->isTest()) { - throw new Exception(Exception::DOMAIN_VERIFICATION_FAILED, 'Unreachable CNAME target (' . $target->get() . '), please use a domain with a public suffix. Please check the _APP_DOMAIN_TARGET environment variable of your Appwrite server.'); + throw new Exception(Exception::DOMAIN_VARIABLE_INCORRECT, 'Unreachable CNAME target (' . $target->get() . '). Please check the _APP_DOMAIN_TARGET environment variable of your Appwrite server.'); } $domain = new Domain($domain);