/**
* Runs a query and unlocks the database on an error.
*
* @param mixed $query A string or DatabaseQuery object.
* @param string $errorMessage Unused.
*
* @return void
*
* @note Since 3.0.0 this method returns void and will rethrow the database exception.
* @since 1.7.0
* @throws \Exception on database error.
*/
protected function _runQuery($query, $errorMessage)
{
// Prepare to catch an exception.
try {
$this->_db->setQuery($query)->execute();
if ($this->_debug) {
$this->_logtable();
}
} catch (\Exception $e) {
// Unlock the tables and rethrow.
$this->_unlock();
throw $e;
}
}