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

@@ -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;

View File

@@ -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 (...) {
}
}