From 39b81214c2f8ba9822f5a832d408fd5bcf1660cd Mon Sep 17 00:00:00 2001 From: Nex Date: Tue, 17 Aug 2021 13:10:36 +0200 Subject: [PATCH] Catching exception when unable to connect to device over TCP --- mvt/android/modules/adb/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mvt/android/modules/adb/base.py b/mvt/android/modules/adb/base.py index 98583b2..f64fb8c 100644 --- a/mvt/android/modules/adb/base.py +++ b/mvt/android/modules/adb/base.py @@ -81,6 +81,11 @@ class AndroidExtraction(MVTModule): except UsbReadFailedError: log.error("Unable to connect to the device over USB. Try to unplug, plug the device and start again.") 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: break