write error message to log file in case insert to file cache failed - took hours to find that the insert failed :-(

This commit is contained in:
Thomas Mueller 2013-03-12 15:32:28 +01:00
parent 569c7ab138
commit 9d4d399aa3
1 changed files with 4 additions and 1 deletions

View File

@ -203,7 +203,10 @@ class Cache {
$query = \OC_DB::prepare('INSERT INTO `*PREFIX*filecache`(' . implode(', ', $queryParts) . ')'
. ' VALUES(' . implode(', ', $valuesPlaceholder) . ')');
$query->execute($params);
$result = $query->execute($params);
if (\MDB2::isError($result)) {
\OCP\Util::writeLog('cache', 'Insert to cache failed: '.$result, \OCP\Util::ERROR);
}
return (int)\OC_DB::insertid('*PREFIX*filecache');
}