mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
feat: update exception class
This commit is contained in:
parent
aeaf6eee18
commit
fb81627b83
1 changed files with 4 additions and 5 deletions
|
|
@ -175,15 +175,14 @@ class Exception extends \Exception
|
||||||
|
|
||||||
protected $type = '';
|
protected $type = '';
|
||||||
|
|
||||||
protected static array $errors = Config::getParam('errors');
|
|
||||||
|
|
||||||
public function __construct(string $type = Exception::GENERAL_UNKNOWN, string $message = null, int $code = null, \Throwable $previous = null)
|
public function __construct(string $type = Exception::GENERAL_UNKNOWN, string $message = null, int $code = null, \Throwable $previous = null)
|
||||||
{
|
{
|
||||||
|
$this->errors = Config::getParam('errors');
|
||||||
$this->type = $type;
|
$this->type = $type;
|
||||||
|
|
||||||
if (isset(self::$errors[$type])) {
|
if (isset($this->errors[$type])) {
|
||||||
$this->code = self::$errors[$type]['code'];
|
$this->code = $this->errors[$type]['code'];
|
||||||
$this->message = self::$errors[$type]['description'];
|
$this->message = $this->errors[$type]['description'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->message = $message ?? $this->message;
|
$this->message = $message ?? $this->message;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue