Wrong exception to be handled

This commit is contained in:
2025-10-29 20:03:11 -04:00
parent 578288d53a
commit d4f6744329

View File

@@ -5,6 +5,8 @@ import argparse
import time import time
import logging import logging
from subprocess import TimeoutExpired
from BetterADBSync import sync_with_options from BetterADBSync import sync_with_options
from tcpip import reconnect_as_tcpip from tcpip import reconnect_as_tcpip
@@ -172,7 +174,7 @@ def main():
logging.info("Reconnecting device over TCP/IP...") logging.info("Reconnecting device over TCP/IP...")
try: try:
tcpip_device = reconnect_as_tcpip(device, adb_path) tcpip_device = reconnect_as_tcpip(device, adb_path)
except (RuntimeError, TimeoutError) as e: except (RuntimeError, TimeoutExpired) as e:
logging.warning(f"Failed to reconnect device over TCP/IP: {e}") logging.warning(f"Failed to reconnect device over TCP/IP: {e}")
logging.warning("Continuing with the current connection after 10 seconds.") logging.warning("Continuing with the current connection after 10 seconds.")
time.sleep(10) time.sleep(10)