Chromium Code Reviews| Index: build/android/pylib/device/remote_device_utils.py |
| diff --git a/build/android/pylib/device/remote_device_utils.py b/build/android/pylib/device/remote_device_utils.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a4cd4887c56a997470b0a9b4026ceac2b1cc1961 |
| --- /dev/null |
| +++ b/build/android/pylib/device/remote_device_utils.py |
| @@ -0,0 +1,21 @@ |
| +# Copyright 2014 The Chromium Authors. All rights reserved. |
|
jbudorick
2014/11/30 22:57:02
I'd prefer a different name for this - the current
rnephew (Reviews Here)
2014/12/02 19:47:49
Chaning it to remote_device_helper for now, open t
|
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +"""Common functions and Exceptions for remote_device_*""" |
| + |
| + |
| +class RemoteDeviceError(Exception): |
| + """Exception to throw when problems occur with remote device service.""" |
| + pass |
| + |
| + |
| +def TestHttpResponse(response, error_msg): |
| + """Checks the Http response from remote device service. |
| + |
| + Args: |
| + response: response dict from the remote device service. |
| + error_msg: Error message to display if bad response is seen. |
| + """ |
| + if response.status_code != 200: |
| + raise RemoteDeviceError(error_msg) |