Catching exception when unable to connect to device over TCP

This commit is contained in:
Nex 2021-08-17 13:10:36 +02:00
parent 94fd6b5208
commit 39b81214c2

View File

@ -81,6 +81,11 @@ class AndroidExtraction(MVTModule):
except UsbReadFailedError: except UsbReadFailedError:
log.error("Unable to connect to the device over USB. Try to unplug, plug the device and start again.") log.error("Unable to connect to the device over USB. Try to unplug, plug the device and start again.")
sys.exit(-1) sys.exit(-1)
except OSError as e:
if e.errno == 113 and self.serial:
log.critical("Unable to connect to the device %s: did you specify the correct IP addres?",
self.serial)
sys.exit(-1)
else: else:
break break