Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Unified Diff: devil/devil/android/forwarder.py

Issue 2808763004: [devil] Raise DeviceUnreachableError on device not found (Closed)
Patch Set: match specific device Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « devil/devil/android/device_test_case.py ('k') | devil/devil/android/sdk/adb_wrapper.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devil/devil/android/forwarder.py
diff --git a/devil/devil/android/forwarder.py b/devil/devil/android/forwarder.py
index 244f555af4f75db5a6b7a037adf9188b6585c0d3..76c56ecc256fd6947de5199905cd481b4e684677 100644
--- a/devil/devil/android/forwarder.py
+++ b/devil/devil/android/forwarder.py
@@ -46,7 +46,8 @@ def _LogMapFailureDiagnostics(device):
logger.info('Last 50 lines of logcat:')
for logcat_line in device.adb.Logcat(dump=True)[-50:]:
logger.info(' %s', logcat_line)
- except device_errors.CommandFailedError:
+ except (device_errors.CommandFailedError,
+ device_errors.DeviceUnreachableError):
# Grabbing the device forwarder log is also best-effort. Ignore all errors.
logger.warning('Failed to get the contents of the logcat.')
@@ -57,7 +58,8 @@ def _LogMapFailureDiagnostics(device):
for line in ps_out:
if 'device_forwarder' in line:
logger.info(' %s', line)
- except device_errors.CommandFailedError:
+ except (device_errors.CommandFailedError,
+ device_errors.DeviceUnreachableError):
logger.warning('Failed to list currently running device_forwarder '
'instances.')
@@ -154,7 +156,8 @@ class Forwarder(object):
if exit_code != 0:
try:
instance._KillDeviceLocked(device, tool)
- except device_errors.CommandFailedError:
+ except (device_errors.CommandFailedError,
+ device_errors.DeviceUnreachableError):
# We don't want the failure to kill the device forwarder to
# supersede the original failure to map.
logging.warning(
« no previous file with comments | « devil/devil/android/device_test_case.py ('k') | devil/devil/android/sdk/adb_wrapper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698