Added error handling

This commit is contained in:
hornet 2022-10-09 00:42:16 -04:00
parent ee4e3227b4
commit a0db0dd040

View File

@ -137,7 +137,11 @@ async def main():
await d.led_off("1f")
await d.play_sound("00", "00")
sleep(10)
except OSError as err:
print(f"Discovery failed due to operating system: {err}")
except BleakError as err:
print(f"Discovery failed due to Bleak: {err}")
finally:
await d.disconnect()