Index: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp |
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp |
index cfcd631d0cca6cabcc09bb9e1ecde684298665d4..06b28ec37546367994df235b0e4639168bdc4e2b 100644 |
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp |
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp |
@@ -48,6 +48,7 @@ DEFINE_TRACE(BluetoothRemoteGATTService) { |
// or with a vector owning the characteristics. |
void BluetoothRemoteGATTService::GetCharacteristicsCallback( |
const String& serviceInstanceId, |
+ const String& requestedCharacteristicUUID, |
mojom::blink::WebBluetoothGATTQueryQuantity quantity, |
ScriptPromiseResolver* resolver, |
mojom::blink::WebBluetoothResult result, |
@@ -85,7 +86,14 @@ void BluetoothRemoteGATTService::GetCharacteristicsCallback( |
} |
resolver->resolve(gattCharacteristics); |
} else { |
- resolver->reject(BluetoothError::take(resolver, result)); |
+ if (result == mojom::blink::WebBluetoothResult::CHARACTERISTIC_NOT_FOUND) { |
+ resolver->reject(BluetoothError::take( |
+ resolver, result, "No Characteristics matching UUID " + |
+ requestedCharacteristicUUID + |
+ " found in Service with UUID " + uuid() + ".")); |
+ } else { |
+ resolver->reject(BluetoothError::take(resolver, result)); |
+ } |
} |
} |
@@ -148,8 +156,8 @@ ScriptPromise BluetoothRemoteGATTService::getCharacteristicsImpl( |
m_service->instance_id, quantity, characteristicsUUID, |
convertToBaseCallback( |
WTF::bind(&BluetoothRemoteGATTService::GetCharacteristicsCallback, |
- wrapPersistent(this), m_service->instance_id, quantity, |
- wrapPersistent(resolver)))); |
+ wrapPersistent(this), m_service->instance_id, |
+ characteristicsUUID, quantity, wrapPersistent(resolver)))); |
return promise; |
} |