mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Improve VCS error when creating repository
This commit is contained in:
parent
1a6530fb57
commit
1b9236ba3f
1 changed files with 7 additions and 4 deletions
|
|
@ -17,14 +17,17 @@ class Exception extends AppwriteException
|
|||
$decoded = json_decode($response, true);
|
||||
if (\is_array($decoded)) {
|
||||
if (\is_array($decoded['error'] ?? '')) {
|
||||
$this->error = $decoded['error']['status'];
|
||||
$this->errorDescription = $decoded['error']['message'];
|
||||
$this->message = $this->error . ': ' . $this->errorDescription;
|
||||
$this->error = $decoded['error']['status'] ?? 'Unknown error';
|
||||
$this->errorDescription = $decoded['error']['message'] ?? 'No description';
|
||||
} else if (\is_array($decoded['errors'] ?? '')) {
|
||||
$this->error = $decoded['error'] ?? $decoded['message'] ?? 'Unknown error';
|
||||
$this->errorDescription = $decoded['errors'][0]['message'] ?? 'No description';
|
||||
} else {
|
||||
$this->error = $decoded['error'] ?? $decoded['message'] ?? 'Unknown error';
|
||||
$this->errorDescription = $decoded['error_description'] ?? 'No description';
|
||||
$this->message = $this->error . ': ' . $this->errorDescription;
|
||||
}
|
||||
|
||||
$this->message = $this->error . ': ' . $this->errorDescription;
|
||||
}
|
||||
$type = match ($code) {
|
||||
400 => AppwriteException::USER_OAUTH2_BAD_REQUEST,
|
||||
|
|
|
|||
Loading…
Reference in a new issue