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 |