From 3b4255c457c1cf150f32bfd003cc3e2b7f844811 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Tue, 1 Aug 2023 18:18:27 +0530 Subject: [PATCH 1/2] fix: error in initialising the Exception constructor in api.php --- app/controllers/shared/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 289fbca8f4..2f0bbbf153 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -27,7 +27,7 @@ $parseLabel = function (string $label, array $responsePayload, array $requestPar $parts = explode('.', $match); if (count($parts) !== 2) { - throw new Exception('Too less or too many parts', 400, Exception::GENERAL_ARGUMENT_INVALID); + throw new Exception(Exception::GENERAL_SERVER_ERROR, "The server encountered an error while parsing the label: $label"); } $namespace = $parts[0] ?? ''; From f6d2df8115dd11648000909b3759c6ed863fb4be Mon Sep 17 00:00:00 2001 From: "Vincent (Wen Yu) Ge" Date: Tue, 1 Aug 2023 12:21:34 -0400 Subject: [PATCH 2/2] Update app/controllers/shared/api.php Co-authored-by: Christy Jacob --- app/controllers/shared/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 2f0bbbf153..daa7f9d5da 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -27,7 +27,7 @@ $parseLabel = function (string $label, array $responsePayload, array $requestPar $parts = explode('.', $match); if (count($parts) !== 2) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, "The server encountered an error while parsing the label: $label"); + throw new Exception(Exception::GENERAL_SERVER_ERROR, "The server encountered an error while parsing the label: $label. Please create an issue on GitHub to allow us to investigate further https://github.com/appwrite/appwrite/issues/new/choose"); } $namespace = $parts[0] ?? '';