[telemetry] Catch NoAdbError when killing the adb server.

BUG=567797,568151

Review URL: https://codereview.chromium.org/1526633003

Cr-Original-Commit-Position: refs/heads/master@{#365102}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d2faab80fa1d4e178254e4e3e3366423acc6ba15
This commit is contained in:
jbudorick 2015-12-14 13:35:46 -08:00 коммит произвёл Commit bot
Родитель 0ad27a3b82
Коммит 53086b4241
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -112,6 +112,6 @@ class NoDevicesError(base_error.BaseError):
class NoAdbError(base_error.BaseError):
"""Exception for being unable to find ADB."""
def __init__(self):
def __init__(self, msg=None):
super(NoAdbError, self).__init__(
'Unable to find adb.', is_infra_error=True)
msg or 'Unable to find adb.', is_infra_error=True)

Просмотреть файл

@ -115,7 +115,7 @@ class AdbWrapper(object):
timeout_retry.CurrentTimeoutThreadGroup().GetRemainingTime())
except OSError as e:
if e.errno in (errno.ENOENT, errno.ENOEXEC):
raise device_errors.NoAdbError()
raise device_errors.NoAdbError(msg=str(e))
else:
raise