Merge pull request #4610 from ks129/fix-4594-function-response-500

Include response of 5xx status codes for function executions
This commit is contained in:
Christy Jacob 2023-02-19 22:37:34 +05:30 committed by GitHub
commit 5d1ada4652
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,6 @@
# Version TBD
- Fix not storing function's response on response codes 5xx [#4610](https://github.com/appwrite/appwrite/pull/4610)
# Version 1.2.1
## Changes
- Upgrade Console to [2.2.0](https://github.com/appwrite/console/releases/tag/2.2.0)

@ -1 +1 @@
Subproject commit 2456d8f21c6e2554056d1a37eab3602024cbb739
Subproject commit 5e2a40c1e397bd341a432698c9d76a3f96315841

View file

@ -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'];