better error message

This commit is contained in:
Gilles Boccon-Gibod
2025-02-05 22:28:05 -05:00
parent 7f5e0d190e
commit 26e87f09fe
2 changed files with 8 additions and 4 deletions

View File

@@ -675,7 +675,7 @@ async def run_receive(
try:
if not audio_io.check_audio_output(output):
return
except (ValueError, ImportError, OSError) as error:
except ValueError as error:
print(error)
return
@@ -820,7 +820,7 @@ async def run_transmit(
try:
if not audio_io.check_audio_input(input):
return
except (ValueError, ImportError, OSError) as error:
except ValueError as error:
print(error)
return

View File

@@ -88,7 +88,9 @@ def check_audio_output(output: str) -> bool:
) from exc
except OSError as exc:
raise ValueError(
'audio output not available (sounddevice python module failed to load)'
'audio output not available '
'(sounddevice python module failed to load: '
f'{exc})'
) from exc
if output == 'device':
@@ -303,7 +305,9 @@ def check_audio_input(input: str) -> bool:
) from exc
except OSError as exc:
raise ValueError(
'audio input not available (sounddevice python module failed to load)'
'audio input not available '
'(sounddevice python module failed to load: '
f'{exc})'
) from exc
if input == 'device':