decoder/Thread, ...: log all exceptions

This commit is contained in:
Max Kellermann 2018-08-09 11:14:40 +02:00
parent 87570cdd9b
commit 01d3777574
8 changed files with 19 additions and 20 deletions

View File

@ -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;
}
}

View File

@ -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

View File

@ -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

View File

@ -175,8 +175,8 @@ SimpleDatabase::Open()
try {
Load();
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
delete root;

View File

@ -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

View File

@ -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());
}
}

View File

@ -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;
}

View File

@ -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));