| 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
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1db7c1b1499b56f936c2f012de339a096429b0b0
|
| --- /dev/null
|
| +++ b/build/android/pylib/device/device_errors.py
|
| @@ -0,0 +1,31 @@
|
| +# Copyright 2014 The Chromium Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +"""
|
| +Exception classes raised by AdbWrapper and DeviceUtils.
|
| +"""
|
| +
|
| +class BaseError(Exception):
|
| + """Base exception for all device and command errors."""
|
| + pass
|
| +
|
| +
|
| +class CommandFailedError(BaseError):
|
| + """Exception for command failures."""
|
| +
|
| + def __init__(self, cmd, msg, device=None):
|
| + super(CommandFailedError, self).__init__(
|
| + (('device %s: ' % device) if device else '') +
|
| + 'adb command \'%s\' failed with message: \'%s\'' % (' '.join(cmd), msg))
|
| +
|
| +
|
| +class CommandTimeoutError(BaseError):
|
| + """Exception for command timeouts."""
|
| + pass
|
| +
|
| +
|
| +class DeviceUnreachableError(BaseError):
|
| + """Exception for device unreachable failures."""
|
| + pass
|
| +
|
|
|