Add description to exception
This commit is contained in:
parent
e267349a88
commit
52b61c5c75
1 changed files with 2 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue