db/update: catch exceptions from Storage plugins

This commit is contained in:
Max Kellermann
2016-09-16 17:05:28 +02:00
parent ab967462e6
commit 100308db02
3 changed files with 41 additions and 10 deletions

View File

@@ -35,6 +35,8 @@
#include "TagArchive.hxx"
#endif
#include <stdexcept>
#include <assert.h>
#include <string.h>
@@ -65,8 +67,13 @@ Song::UpdateFile(Storage &storage)
const auto &relative_uri = GetURI();
StorageFileInfo info;
if (!storage.GetInfo(relative_uri.c_str(), true, info, IgnoreError()))
try {
if (!storage.GetInfo(relative_uri.c_str(), true, info,
IgnoreError()))
return false;
} catch (const std::runtime_error &) {
return false;
}
if (!info.IsRegular())
return false;