diff --git a/src/Appwrite/Auth/OAuth2/Exception.php b/src/Appwrite/Auth/OAuth2/Exception.php index af98fa5e9d..99408b8d64 100644 --- a/src/Appwrite/Auth/OAuth2/Exception.php +++ b/src/Appwrite/Auth/OAuth2/Exception.php @@ -16,8 +16,8 @@ class Exception extends AppwriteException $this->message = $response; $decoded = json_decode($response, true); if (\is_array($decoded)) { - $this->error = $decoded['error']; - $this->errorDescription = $decoded['error_description']; + $this->error = $decoded['error'] ?? $decoded['message'] ?? "Unknown error"; + $this->errorDescription = $decoded['error_description'] ?? "No description"; $this->message = $this->error . ': ' . $this->errorDescription; } $type = match ($code) {