public function error($msg)
    {
        file_put_contents($this->config['logDir'] . self::LOG_FILE, date('Y-m-d h:m:s') . ' :: ' . $msg . "\n",
            FILE_APPEND);

        // log set as true
        if ($this->log) {
            // show executed query with error
            $this->showQuery();
            // die code
            $this->helper()->errorBox($msg);
        }

        throw new \PDOException($msg);
    }