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..8a0767ee0459716dee989d85bc12e7d4af402001 100644 |
--- a/build/android/pylib/device/device_errors.py |
+++ b/build/android/pylib/device/device_errors.py |
@@ -24,10 +24,21 @@ 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: %r' % (' '.join(cmd), msg), |
device=device) |
+class AdbShellCommandFailedError(CommandFailedError): |
jbudorick
2014/10/17 09:04:53
This should inherit from AdbCommandFailedError.
perezju
2014/10/17 11:17:09
Done.
The new version will output something like:
|
+ """Exception for adb shell command failing with non-zero return code.""" |
+ |
+ def __init__(self, cmd, return_code, output, device=None): |
+ super(AdbShellCommandFailedError, self).__init__( |
+ 'adb shell command %r failed with return code %d and output %r' % |
jbudorick
2014/10/17 09:04:53
You may want to rephrase this to distinguish the e
perezju
2014/10/17 11:17:09
That's what %r does :)
And the return code should
jbudorick
2014/10/17 15:48:00
Oh, neat. I didn't know about %r and somehow read
|
+ (cmd, return_code, output), device=device) |
+ self.return_code = return_code |
+ self.output = output |
+ |
+ |
class CommandTimeoutError(BaseError): |
"""Exception for command timeouts.""" |
pass |