From: Pawel Wasowski Date: Wed, 16 Sep 2020 05:26:14 +0000 (+0200) Subject: [Bluetooth] Change default error used by server's getConnectionMtu() X-Git-Tag: submit/tizen/20200918.124009~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a9c05ae256b4698648c035af80905c7e1599eff;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Bluetooth] Change default error used by server's getConnectionMtu() 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 Signed-off-by: Pawel Wasowski --- diff --git a/src/bluetooth/bluetooth_api.js b/src/bluetooth/bluetooth_api.js index 79771fc9..290a4111 100755 --- a/src/bluetooth/bluetooth_api.js +++ b/src/bluetooth/bluetooth_api.js @@ -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 ); } };