Main, ...: catch any exception, not just std::runtime_error
This commit is contained in:
@@ -875,7 +875,7 @@ try {
|
||||
call */
|
||||
return;
|
||||
}
|
||||
} catch (const std::runtime_error &) {
|
||||
} catch (...) {
|
||||
MultiSocketMonitor::Reset();
|
||||
LockCaughtError();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -856,7 +856,7 @@ try {
|
||||
PulseOutput po(empty);
|
||||
po.WaitConnection();
|
||||
return true;
|
||||
} catch (const std::runtime_error &e) {
|
||||
} catch (...) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ ShoutOutput::Close() noexcept
|
||||
try {
|
||||
encoder->End();
|
||||
WritePage();
|
||||
} catch (const std::runtime_error &) {
|
||||
} catch (...) {
|
||||
/* ignore */
|
||||
}
|
||||
|
||||
|
||||
@@ -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 */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user