diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index 70f3ee8e65..7b2f2644e6 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -175,15 +175,14 @@ class Exception extends \Exception 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) { + $this->errors = Config::getParam('errors'); $this->type = $type; - if (isset(self::$errors[$type])) { - $this->code = self::$errors[$type]['code']; - $this->message = self::$errors[$type]['description']; + if (isset($this->errors[$type])) { + $this->code = $this->errors[$type]['code']; + $this->message = $this->errors[$type]['description']; } $this->message = $message ?? $this->message;