From: Lukasz Bardeli Date: Sun, 27 Nov 2016 14:18:11 +0000 (+0100) Subject: [Convergance] refactoring throw InvalidStateError X-Git-Tag: submit/tizen/20161128.110522^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb711ac747f8b6f88b588bc8c9ce6ca1072f4895;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Convergance] refactoring throw InvalidStateError Change-Id: Ibc226f1fe694abc0bdb4740fb58198060df33753 Signed-off-by: Lukasz Bardeli --- diff --git a/src/convergence/convergence_api.js b/src/convergence/convergence_api.js index 2e06968d..ab9bf66d 100644 --- a/src/convergence/convergence_api.js +++ b/src/convergence/convergence_api.js @@ -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', {