Chromium Code Reviews| 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' |
|
jbudorick
2014/10/17 15:48:00
So, to be clear, raising one of these will result
perezju
2014/10/17 16:11:12
Yes, but with single rather than double quotes. Al
|
| + % (cmd, return_code, output), |
| + device=device) |
| + self.return_code = return_code |
| + self.output = output |
| + |
| + |
| class CommandTimeoutError(BaseError): |
| """Exception for command timeouts.""" |
| pass |