[Bluetooth] Change default error used by server's getConnectionMtu() 09/244409/2
authorPawel Wasowski <p.wasowski2@samsung.com>
Wed, 16 Sep 2020 05:26:14 +0000 (07:26 +0200)
committerPawel Wasowski <p.wasowski2@samsung.com>
Wed, 16 Sep 2020 05:48:26 +0000 (07:48 +0200)
According to the API reference, the default error used by
BluetoothGATTServer::getConnectionMtu() should be AbortError and
not UnknownError.
This commit fixes that.

[Verification] Code compiles, getConnectionMtu() works fine in console.

Change-Id: Ice6c7ac1a75418069ede94c3d8203cbb781f3d57
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
Signed-off-by: Pawel Wasowski <p.wasowski2@samsung.com>
src/bluetooth/bluetooth_api.js

index 79771fc..290a411 100755 (executable)
@@ -21,6 +21,8 @@ var Privilege = xwalk.utils.privilege;
 var privUtils_ = xwalk.utils;
 var native = new xwalk.utils.NativeManager(extension);
 
+var AbortError = new WebAPIException('AbortError', 'An unknown error occurred');
+
 // class BluetoothClassDeviceMajor /////////////////////////////////////////
 var BluetoothClassDeviceMajor = function() {
     Object.defineProperties(this, {
@@ -3803,8 +3805,6 @@ var BluetoothGATTServer = function() {
     );
 };
 
-var AbortError = new WebAPIException('AbortError', 'An unknown error occurred');
-
 var BluetoothGATTServer_valid_registerService_errors = [
     'InvalidStateError',
     'NotSupportedError',
@@ -4088,7 +4088,7 @@ BluetoothGATTServer.prototype.stop = function() {
 var BluetoothGATTServer_valid_getConnectionMtu_errors = [
     'InvalidStateError',
     'NotSupportedError',
-    'UnknownError'
+    'AbortError'
 ];
 var BluetoothGATTServer_valid_getConnectionMtu_exceptions = [
     'TypeMismatchError',
@@ -4120,7 +4120,7 @@ BluetoothGATTServer.prototype.getConnectionMtu = function() {
                 native.getErrorObjectAndValidate(
                     result,
                     BluetoothGATTServer_valid_getConnectionMtu_errors,
-                    UnknownError
+                    AbortError
                 )
             );
         } else {
@@ -4137,7 +4137,7 @@ BluetoothGATTServer.prototype.getConnectionMtu = function() {
         throw native.getErrorObjectAndValidate(
             result,
             BluetoothGATTServer_valid_getConnectionMtu_exceptions,
-            UnknownError
+            AbortError
         );
     }
 };