fs/DirectoryReader: use C++ exceptions instead of class Error

This commit is contained in:
Max Kellermann
2015-12-29 12:41:45 +01:00
parent 826a654c95
commit f3503e0026
12 changed files with 79 additions and 76 deletions

View File

@@ -218,7 +218,7 @@ void
UpdateWalk::UpdateDirectoryChild(Directory &directory,
const ExcludeList &exclude_list,
const char *name, const StorageFileInfo &info)
{
try {
assert(strchr(name, '/') == nullptr);
if (info.IsRegular()) {
@@ -242,6 +242,8 @@ UpdateWalk::UpdateDirectoryChild(Directory &directory,
FormatDebug(update_domain,
"%s is not a directory, archive or music", name);
}
} catch (const std::exception &e) {
LogError(e);
}
/* we don't look at "." / ".." nor files with newlines in their name */
@@ -455,7 +457,7 @@ UpdateWalk::DirectoryMakeUriParentChecked(Directory &root, const char *uri)
inline void
UpdateWalk::UpdateUri(Directory &root, const char *uri)
{
try {
Directory *parent = DirectoryMakeUriParentChecked(root, uri);
if (parent == nullptr)
return;
@@ -476,6 +478,8 @@ UpdateWalk::UpdateUri(Directory &root, const char *uri)
ExcludeList exclude_list;
UpdateDirectoryChild(*parent, exclude_list, name, info);
} catch (const std::exception &e) {
LogError(e);
}
bool