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

Unified Diff: build/android/pylib/device/device_errors.py

Issue 659533002: New run shell implementation for DeviceUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed nit, and TODO to make cmd_helper_test run on bots Created 6 years, 2 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 | « build/android/pylib/device/adb_wrapper_test.py ('k') | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/device_errors.py
diff --git a/build/android/pylib/device/device_errors.py b/build/android/pylib/device/device_errors.py
index acc760385618c04ab6fe1b72f55b8b8176ec2401..7d1ebe6ae96c968232ff508c3f806cdd16acf779 100644
--- a/build/android/pylib/device/device_errors.py
+++ b/build/android/pylib/device/device_errors.py
@@ -24,10 +24,23 @@ class AdbCommandFailedError(CommandFailedError):
def __init__(self, cmd, msg, device=None):
super(AdbCommandFailedError, self).__init__(
- 'adb command \'%s\' failed with message: \'%s\'' % (' '.join(cmd), msg),
+ 'adb command %r failed with message: %s' % (' '.join(cmd), msg),
device=device)
+class AdbShellCommandFailedError(AdbCommandFailedError):
+ """Exception for adb shell command failing with non-zero return code."""
+
+ def __init__(self, cmd, return_code, output, device=None):
+ super(AdbShellCommandFailedError, self).__init__(
+ ['shell'],
+ 'command %r on device failed with return code %d and output %r'
+ % (cmd, return_code, output),
+ device=device)
+ self.return_code = return_code
+ self.output = output
+
+
class CommandTimeoutError(BaseError):
"""Exception for command timeouts."""
pass
« no previous file with comments | « build/android/pylib/device/adb_wrapper_test.py ('k') | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698