From 6ae1a122199f044671deba75f06b9613edbd62a5 Mon Sep 17 00:00:00 2001 From: Karlis Suvi <45097959+ks129@users.noreply.github.com> Date: Sat, 29 Oct 2022 09:04:57 +0000 Subject: [PATCH 1/2] Include response of 5xx status codes for function executions --- app/executor.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/executor.php b/app/executor.php index fba8c4c416..a8fa9eb1cd 100644 --- a/app/executor.php +++ b/app/executor.php @@ -548,6 +548,10 @@ App::post('/v1/execution') case $statusCode >= 500: $stderr = ($executorResponse ?? [])['stderr'] ?? 'Internal Runtime error.'; $stdout = ($executorResponse ?? [])['stdout'] ?? 'Internal Runtime error.'; + $res = ($executorResponse ?? [])['response'] ?? ''; + if (is_array($res)) { + $res = json_encode($res, JSON_UNESCAPED_UNICODE); + } break; case $statusCode >= 100: $stdout = $executorResponse['stdout']; From a82c8e88c283eae21454a8ffd092d5644ca88f31 Mon Sep 17 00:00:00 2001 From: Karlis Suvi <45097959+ks129@users.noreply.github.com> Date: Sun, 30 Oct 2022 12:14:01 +0200 Subject: [PATCH 2/2] Add changelog entry for #4610 --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 340aec16d4..5c34d9cd14 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ## Bugs - Fix license detection for Flutter and Dart SDKs [#4435](https://github.com/appwrite/appwrite/pull/4435) +- Fix not storing function's response on response codes 5xx [#4610](https://github.com/appwrite/appwrite/pull/4610) # Version 1.0.3 ## Bugs