Main, ...: catch any exception, not just std::runtime_error

This commit is contained in:
Max Kellermann
2017-12-19 10:56:23 +01:00
parent a539094c06
commit 914df18bf9
79 changed files with 236 additions and 244 deletions

View File

@@ -875,7 +875,7 @@ try {
call */
return;
}
} catch (const std::runtime_error &) {
} catch (...) {
MultiSocketMonitor::Reset();
LockCaughtError();
}

View File

@@ -92,8 +92,8 @@ FifoOutput::Delete()
try {
RemoveFile(path);
} catch (const std::runtime_error &e) {
LogError(e, "Could not remove FIFO");
} catch (...) {
LogError(std::current_exception(), "Could not remove FIFO");
return;
}

View File

@@ -856,7 +856,7 @@ try {
PulseOutput po(empty);
po.WaitConnection();
return true;
} catch (const std::runtime_error &e) {
} catch (...) {
return false;
}

View File

@@ -154,7 +154,7 @@ RecorderOutput::Open(AudioFormat &audio_format)
try {
encoder = prepared_encoder->Open(audio_format);
} catch (const std::runtime_error &) {
} catch (...) {
delete file;
throw;
}
@@ -162,7 +162,7 @@ RecorderOutput::Open(AudioFormat &audio_format)
if (!HasDynamicPath()) {
try {
EncoderToFile();
} catch (const std::runtime_error &) {
} catch (...) {
delete encoder;
throw;
}
@@ -218,8 +218,8 @@ RecorderOutput::Close() noexcept
try {
Commit();
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
}
if (HasDynamicPath()) {
@@ -238,8 +238,8 @@ RecorderOutput::FinishFormat()
try {
Commit();
} catch (const std::exception &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
}
file = nullptr;
@@ -270,7 +270,7 @@ RecorderOutput::ReopenFormat(AllocatedPath &&new_path)
try {
EncoderToOutputStream(*new_file, *encoder);
} catch (const std::exception &e) {
} catch (...) {
delete encoder;
delete new_file;
throw;
@@ -302,8 +302,8 @@ RecorderOutput::SendTag(const Tag &tag)
try {
new_path = ParsePath(p);
} catch (const std::runtime_error &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
FinishFormat();
return;
}
@@ -313,8 +313,8 @@ RecorderOutput::SendTag(const Tag &tag)
try {
ReopenFormat(std::move(new_path));
} catch (const std::runtime_error &e) {
LogError(e);
} catch (...) {
LogError(std::current_exception());
return;
}
}

View File

@@ -251,7 +251,7 @@ ShoutOutput::Close() noexcept
try {
encoder->End();
WritePage();
} catch (const std::runtime_error &) {
} catch (...) {
/* ignore */
}

View File

@@ -179,7 +179,7 @@ HttpdOutput::ReadPage()
buffer underruns */
try {
encoder->Flush();
} catch (const std::runtime_error &) {
} catch (...) {
/* ignore */
}
@@ -376,7 +376,7 @@ HttpdOutput::SendTag(const Tag &tag)
try {
encoder->PreTag();
} catch (const std::runtime_error &) {
} catch (...) {
/* ignore */
}
@@ -388,7 +388,7 @@ HttpdOutput::SendTag(const Tag &tag)
try {
encoder->SendTag(tag);
encoder->Flush();
} catch (const std::runtime_error &) {
} catch (...) {
/* ignore */
}