public function error($link) { /* @var $link \mysqli */ return new MysqliException($link->error, $link->errno); }