Commit 242ab286 authored by bryeung@chromium.org's avatar bryeung@chromium.org

Improve errors for the bluetooth.connect API

TEST=none
BUG=none

R=asargent@chromium.org


Review URL: https://chromiumcodereview.appspot.com/10539054

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141208 0039d316-1c4b-4281-b951-d872f2087c98
parent 2214a238
......@@ -43,6 +43,8 @@ chromeos::BluetoothAdapter* GetMutableAdapter(Profile* profile) {
namespace {
const char kFailedToConnect[] = "Connection failed";
const char kInvalidDevice[] = "Invalid device";
const char kSocketNotFoundError[] = "Socket not found: invalid socket id";
} // namespace
......@@ -165,6 +167,7 @@ void BluetoothConnectFunction::ConnectToServiceCallback(
result_.reset(result_socket.ToValue().release());
SendResponse(true);
} else {
SetError(kFailedToConnect);
SendResponse(false);
}
......@@ -179,6 +182,7 @@ bool BluetoothConnectFunction::RunImpl() {
GetMutableAdapter(profile())->GetDevice(params->device.address);
if (!device) {
SendResponse(false);
SetError(kInvalidDevice);
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment