Update src/Appwrite/Extend/Exception.php
This commit is contained in:
parent
e6b6e4e54e
commit
9bf13a2400
1 changed files with 6 additions and 2 deletions
|
@ -302,8 +302,12 @@ class Exception extends \Exception
|
|||
$this->type = $type;
|
||||
$this->code = $code ?? $this->errors[$type]['code'];
|
||||
|
||||
if(\is_string($this->code) && !\is_numeric($this->code)) {
|
||||
$this->code = 500;
|
||||
if(\is_string($this->code)) {
|
||||
if (\is_numeric($this->code)) {
|
||||
$this->code = (int) $this->code;
|
||||
} else {
|
||||
$this->code = 500;
|
||||
}
|
||||
}
|
||||
|
||||
$this->message = $message ?? $this->errors[$type]['description'];
|
||||
|
|
Loading…
Reference in a new issue