summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-10-29 11:01:15 +0100
committerMax Kellermann <max@musicpd.org>2018-10-29 11:05:50 +0100
commitf76544be4c0e7539e326d1f598c183970404bea7 (patch)
tree209b9c44570687d0b423a902022ac9cae102c3e7 /src
parent1e6c445320a42acd0169e8546411c4b58b212b8e (diff)
db/update: catch all exceptions
Diffstat (limited to 'src')
-rw-r--r--src/db/update/Archive.cxx4
-rw-r--r--src/db/update/Container.cxx4
-rw-r--r--src/db/update/ExcludeList.cxx2
-rw-r--r--src/db/update/InotifyUpdate.cxx16
-rw-r--r--src/db/update/UpdateIO.cxx12
-rw-r--r--src/db/update/Walk.cxx4
6 files changed, 21 insertions, 21 deletions
diff --git a/src/db/update/Archive.cxx b/src/db/update/Archive.cxx
index 6004ed835..88950e3c3 100644
--- a/src/db/update/Archive.cxx
+++ b/src/db/update/Archive.cxx
@@ -153,8 +153,8 @@ UpdateWalk::UpdateArchiveFile(Directory &parent, const char *name,
ArchiveFile *file;
try {
file = archive_file_open(&plugin, path_fs);
- } catch (const std::runtime_error &e) {
- LogError(e);
+ } catch (...) {
+ LogError(std::current_exception());
if (directory != nullptr)
editor.LockDeleteDirectory(directory);
return;
diff --git a/src/db/update/Container.cxx b/src/db/update/Container.cxx
index fc4ec416c..6067145e4 100644
--- a/src/db/update/Container.cxx
+++ b/src/db/update/Container.cxx
@@ -119,9 +119,9 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
modified = true;
}
- } catch (const std::runtime_error &e) {
+ } catch (...) {
editor.LockDeleteDirectory(contdir);
- LogError(e);
+ LogError(std::current_exception());
return false;
}
diff --git a/src/db/update/ExcludeList.cxx b/src/db/update/ExcludeList.cxx
index 332e4bbc7..fadc8817a 100644
--- a/src/db/update/ExcludeList.cxx
+++ b/src/db/update/ExcludeList.cxx
@@ -78,7 +78,7 @@ ExcludeList::Check(Path name_fs) const noexcept
try {
if (i.Check(NarrowPath(name_fs).c_str()))
return true;
- } catch (const std::runtime_error &) {
+ } catch (...) {
}
}
#else
diff --git a/src/db/update/InotifyUpdate.cxx b/src/db/update/InotifyUpdate.cxx
index 562315fa3..bd82f3e7a 100644
--- a/src/db/update/InotifyUpdate.cxx
+++ b/src/db/update/InotifyUpdate.cxx
@@ -187,8 +187,8 @@ recursive_watch_subdirectories(WatchDirectory *directory,
FileInfo fi;
try {
fi = FileInfo(child_path_fs);
- } catch (const std::runtime_error &e) {
- LogError(e);
+ } catch (...) {
+ LogError(std::current_exception());
continue;
}
@@ -198,8 +198,8 @@ recursive_watch_subdirectories(WatchDirectory *directory,
try {
ret = inotify_source->Add(child_path_fs.c_str(),
IN_MASK);
- } catch (const std::runtime_error &e) {
- FormatError(e,
+ } catch (...) {
+ FormatError(std::current_exception(),
"Failed to register %s",
child_path_fs.c_str());
continue;
@@ -302,8 +302,8 @@ mpd_inotify_init(EventLoop &loop, Storage &storage, UpdateService &update,
inotify_source = new InotifySource(loop,
mpd_inotify_callback,
nullptr);
- } catch (const std::runtime_error &e) {
- LogError(e);
+ } catch (...) {
+ LogError(std::current_exception());
return;
}
@@ -312,8 +312,8 @@ mpd_inotify_init(EventLoop &loop, Storage &storage, UpdateService &update,
int descriptor;
try {
descriptor = inotify_source->Add(path.c_str(), IN_MASK);
- } catch (const std::runtime_error &e) {
- LogError(e);
+ } catch (...) {
+ LogError(std::current_exception());
delete inotify_source;
inotify_source = nullptr;
return;
diff --git a/src/db/update/UpdateIO.cxx b/src/db/update/UpdateIO.cxx
index 2623b0dc4..6977204de 100644
--- a/src/db/update/UpdateIO.cxx
+++ b/src/db/update/UpdateIO.cxx
@@ -36,8 +36,8 @@ GetInfo(Storage &storage, const char *uri_utf8, StorageFileInfo &info) noexcept
try {
info = storage.GetInfo(uri_utf8, true);
return true;
-} catch (const std::runtime_error &e) {
- LogError(e);
+} catch (...) {
+ LogError(std::current_exception());
return false;
}
@@ -46,8 +46,8 @@ GetInfo(StorageDirectoryReader &reader, StorageFileInfo &info) noexcept
try {
info = reader.GetInfo(true);
return true;
-} catch (const std::runtime_error &e) {
- LogError(e);
+} catch (...) {
+ LogError(std::current_exception());
return false;
}
@@ -58,7 +58,7 @@ DirectoryExists(Storage &storage, const Directory &directory) noexcept
try {
info = storage.GetInfo(directory.GetPath(), true);
- } catch (const std::runtime_error &) {
+ } catch (...) {
return false;
}
@@ -83,7 +83,7 @@ directory_child_is_regular(Storage &storage, const Directory &directory,
try {
return GetDirectoryChildInfo(storage, directory, name_utf8)
.IsRegular();
-} catch (const std::runtime_error &) {
+} catch (...) {
return false;
}
diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx
index c71b3d73c..da13f0d5d 100644
--- a/src/db/update/Walk.cxx
+++ b/src/db/update/Walk.cxx
@@ -244,8 +244,8 @@ try {
FormatDebug(update_domain,
"%s is not a directory, archive or music", name);
}
-} catch (const std::exception &e) {
- LogError(e);
+} catch (...) {
+ LogError(std::current_exception());
}
/* we don't look at "." / ".." nor files with newlines in their name */