output/wasapi: SafeTry() catches all exceptions
Fixes crash due to std::stoul() throwing std::invalid_argument.
This commit is contained in:
parent
9ff790b7bb
commit
17f7098e27
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue