Main, ...: catch any exception, not just std::runtime_error
This commit is contained in:
@@ -43,8 +43,8 @@ output_mixer_get_volume(const AudioOutputControl &ao) noexcept
|
||||
|
||||
try {
|
||||
return mixer_get_volume(mixer);
|
||||
} catch (const std::runtime_error &e) {
|
||||
FormatError(e,
|
||||
} catch (...) {
|
||||
FormatError(std::current_exception(),
|
||||
"Failed to read mixer for '%s'",
|
||||
ao.GetName());
|
||||
return -1;
|
||||
@@ -86,8 +86,8 @@ output_mixer_set_volume(AudioOutputControl &ao, unsigned volume) noexcept
|
||||
try {
|
||||
mixer_set_volume(mixer, volume);
|
||||
return true;
|
||||
} catch (const std::runtime_error &e) {
|
||||
FormatError(e,
|
||||
} catch (...) {
|
||||
FormatError(std::current_exception(),
|
||||
"Failed to set mixer for '%s'",
|
||||
ao.GetName());
|
||||
return false;
|
||||
|
@@ -149,7 +149,7 @@ alsa_mixer_elem_callback(snd_mixer_elem_t *elem, unsigned mask)
|
||||
try {
|
||||
int volume = mixer.GetVolume();
|
||||
mixer.listener.OnMixerVolumeChanged(mixer, volume);
|
||||
} catch (const std::runtime_error &) {
|
||||
} catch (...) {
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user