mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: bugs in exception class
This commit is contained in:
@@ -51,20 +51,10 @@ class Exception extends \Exception
|
||||
|
||||
private $errorCode = '';
|
||||
|
||||
static $codes = Config::getParam('errorCodes', []);
|
||||
|
||||
public function __construct(string $message, int $code = 0, string $errorCode = Exception::TYPE_NONE, \Throwable $previous = null)
|
||||
{
|
||||
if (!isset(self::$codes)) {
|
||||
throw new \Exception('Error codes not found', 500);
|
||||
}
|
||||
|
||||
$this->errorCode = $errorCode;
|
||||
|
||||
if (isset(self::$codes[$errorCode])) {
|
||||
$this->$message = self::$codes[$errorCode]['statusCode'];
|
||||
}
|
||||
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user