1
0
Fork 0
mirror of synced 2024-10-03 19:53:33 +13:00

Update src/Appwrite/Extend/Exception.php

This commit is contained in:
Jake Barnby 2024-04-30 12:28:29 +12:00 committed by GitHub
parent e6b6e4e54e
commit 9bf13a2400
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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'];