[DB] Catch permission file errors when updating

This commit is contained in:
emeric
2015-08-11 13:53:49 +02:00
parent abeeace454
commit 6fa1ba1300
+10 -1
View File
@@ -589,6 +589,8 @@ Updater::processDirectory(const boost::filesystem::path& rootDirectory,
bool bool
Updater::checkFile(const boost::filesystem::path& p, const std::vector<boost::filesystem::path>& rootDirs, const std::vector<boost::filesystem::path>& extensions) Updater::checkFile(const boost::filesystem::path& p, const std::vector<boost::filesystem::path>& rootDirs, const std::vector<boost::filesystem::path>& extensions)
{ {
try
{
bool status = true; bool status = true;
// For each track, make sure the the file still exists // For each track, make sure the the file still exists
@@ -624,8 +626,15 @@ Updater::checkFile(const boost::filesystem::path& p, const std::vector<boost::fi
} }
return status; return status;
}
}
catch (boost::filesystem::filesystem_error& e)
{
LMS_LOG(MOD_DBUPDATER, SEV_ERROR) << "Caught exception while checking file '" << p << "': " << e.what();
return false;
}
}
void void
Updater::checkAudioFiles( Stats& stats ) Updater::checkAudioFiles( Stats& stats )