Commit 01d37775 authored by Max Kellermann's avatar Max Kellermann

decoder/Thread, ...: log all exceptions

parent 87570cdd
......@@ -545,8 +545,8 @@ int mpd_main(int argc, char *argv[]) noexcept
try {
return MainOrThrow(argc, argv);
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
return EXIT_FAILURE;
}
}
......
......@@ -102,8 +102,8 @@ StateFile::Write()
FileOutputStream fos(config.path);
Write(fos);
fos.Commit();
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
}
RememberVersions();
......@@ -143,8 +143,8 @@ try {
}
RememberVersions();
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
}
void
......
......@@ -179,8 +179,8 @@ handle_lsinfo_relative(Client &client, Response &r, const char *uri)
if (isRootDirectory(uri)) {
try {
print_spl_list(r, ListPlaylistFiles());
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
}
} else {
#ifndef ENABLE_DATABASE
......
......@@ -175,8 +175,8 @@ SimpleDatabase::Open()
try {
Load();
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
delete root;
......
......@@ -234,8 +234,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 */
......@@ -477,8 +477,8 @@ try {
ExcludeList exclude_list;
UpdateDirectoryChild(*parent, exclude_list, name, info);
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
}
bool
......
......@@ -536,9 +536,8 @@ DecoderControl::RunThread() noexcept
if (state == DecoderState::ERROR) {
try {
std::rethrow_exception(error);
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
}
}
......
......@@ -255,9 +255,9 @@ FfmpegSendFrame(DecoderClient &client, InputStream &is,
try {
output_buffer = copy_interleave_frame(codec_context, frame,
buffer);
} catch (const std::exception &e) {
} catch (...) {
/* this must be a serious error, e.g. OOM */
LogError(e);
LogError(std::current_exception());
return DecoderCommand::STOP;
}
......
......@@ -81,8 +81,8 @@ UPnPDeviceDirectory::Downloader::OnEnd()
try {
d.Parse(url, data.c_str());
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
}
parent.LockAdd(std::move(d));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment