mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Add description to exception
This commit is contained in:
1 parent
e267349a88
commit
52b61c5c75
1 file changed
+2
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user