mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
feat: update exception class
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user