/** * Execute a PDOStatement and throws an exception in case of any error * * @param \PDOStatement $st * @throws \Exception */ private function _execute(\PDOStatement $st) { if (!$st->execute()) { $this->_db->rollBack(); $error = $st->errorInfo(); throw new \Exception('Error trying to execute query "' . $st->queryString . '": ' . $error[2]); } }