обработка ошибки подключения к базе
This commit is contained in:
parent
6e730bc841
commit
794570171d
@ -10,8 +10,9 @@ class EffectsModel
|
||||
protected $DB;
|
||||
const EFFECT_HIDEUSERINFO = 5;
|
||||
public function __construct(int $user_id) {
|
||||
$this->DB = db::c()->query('SELECT * FROM effects WHERE owner_id = ?i', $user_id);
|
||||
throw new Exception('<div class="debug">Не могу подключиться к таблице effects!</div>');
|
||||
try {
|
||||
$this->DB = db::c()->query('SELECT * FROM effects WHERE owner_id = ?i', $user_id);
|
||||
} catch (Exception $e) {echo '<div class="debug">class EffectsModel: Не могу подключиться к таблице effects!</div>';}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user