1
0
Fork 0
mirror of synced 2024-07-04 14:10:33 +12:00

Merge pull request #4766 from appwrite/fb-pools-executor-err-handling

Improve: Executor error handler
This commit is contained in:
Christy Jacob 2022-11-23 14:15:57 +05:30 committed by GitHub
commit e38b5cee8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,7 +94,8 @@ class Executor
$status = $response['headers']['status-code'];
if ($status >= 400) {
throw new \Exception($response['body']['message'], $status);
$message = \is_string($response['body']) ? $response['body'] : $response['body']['message'];
throw new \Exception($message, $status);
}
return $response['body'];
@ -146,7 +147,8 @@ class Executor
$status = $response['headers']['status-code'];
if ($status >= 400) {
throw new \Exception($response['body']['message'], $status);
$message = \is_string($response['body']) ? $response['body'] : $response['body']['message'];
throw new \Exception($message, $status);
}
return $response['body'];