[Convergance] refactoring throw InvalidStateError 26/100326/3
authorLukasz Bardeli <l.bardeli@samsung.com>
Sun, 27 Nov 2016 14:18:11 +0000 (15:18 +0100)
committerHyunjin Park <hj.na.park@samsung.com>
Mon, 28 Nov 2016 04:33:41 +0000 (13:33 +0900)
Change-Id: Ibc226f1fe694abc0bdb4740fb58198060df33753
Signed-off-by: Lukasz Bardeli <l.bardeli@samsung.com>
src/convergence/convergence_api.js

index 2e06968de303160cf7320e938aaedff0797f7681..ab9bf66dcc41dc5a2fa0a2e8cadb7f9e47b83747 100644 (file)
@@ -341,8 +341,9 @@ RemoteAppControlService.prototype.connect = function(successCallback, errorCallb
     }
   ]);
 
-  if (this.connectionState == ConnectionState.CONNECTED)
-    throw new WebAPIException('InvalidStateError', 'Service is connected already.');
+  if (this.connectionState == ConnectionState.CONNECTED) {
+    throw new WebAPIException(WebAPIException.INVALID_STATE_ERR, 'Service is connected already.');
+  }
 
   var lid = this._serviceId;
   this._connectCallback = successCallback;
@@ -380,7 +381,7 @@ RemoteAppControlService.prototype.disconnect = function(successCallback, errorCa
   ]);
 
   if (this.connectionState != ConnectionState.CONNECTED) {
-    throw new WebAPIException('InvalidStateError', 'Service is not connected yet.');
+    throw new WebAPIException(WebAPIException.INVALID_STATE_ERR, 'Service is not connected yet.');
   }
 
   var result = native_.call('RemoteAppControlService_disconnect', {