output/wasapi: SafeTry() catches all exceptions

Fixes crash due to std::stoul() throwing std::invalid_argument.
This commit is contained in:
Max Kellermann 2021-03-05 19:11:57 +01:00
parent 9ff790b7bb
commit 17f7098e27
1 changed files with 3 additions and 3 deletions

View File

@ -90,8 +90,8 @@ inline bool SafeTry(Functor &&functor) {
try {
functor();
return true;
} catch (std::runtime_error &err) {
FormatError(wasapi_output_domain, "%s", err.what());
} catch (...) {
FormatError(std::current_exception(), "%s");
return false;
}
}
@ -101,7 +101,7 @@ inline bool SafeSilenceTry(Functor &&functor) {
try {
functor();
return true;
} catch (std::runtime_error &err) {
} catch (...) {
return false;
}
}