From fb711ac747f8b6f88b588bc8c9ce6ca1072f4895 Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Sun, 27 Nov 2016 15:18:11 +0100 Subject: [PATCH] [Convergance] refactoring throw InvalidStateError Change-Id: Ibc226f1fe694abc0bdb4740fb58198060df33753 Signed-off-by: Lukasz Bardeli --- src/convergence/convergence_api.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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', { -- 2.34.1