From: Pawel Andruszkiewicz
Date: Mon, 27 Jul 2015 11:41:51 +0000 (+0200)
Subject: [Application] Throw an exception if requested listener is not found.
X-Git-Tag: submit/tizen_tv/20150803.021740^2^2~20^2
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=875795bbac048ffab77ffc63604aa3ef001321e8;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Application] Throw an exception if requested listener is not found.
[Verification] UTC_application_removeAppInfoEventListener_N_001 passes.
TCT pass rate: 100%
Change-Id: Ia394cabe0f98f79fd787c22abcc4612d627f8e11
Signed-off-by: Pawel Andruszkiewicz
---
diff --git a/src/application/application_api.js b/src/application/application_api.js
index ad176bde..4a5d757c 100755
--- a/src/application/application_api.js
+++ b/src/application/application_api.js
@@ -529,6 +529,8 @@ ListenerManager.prototype.addListener = function(callback) {
ListenerManager.prototype.removeListener = function(watchId) {
if (this.listeners.hasOwnProperty(watchId)) {
delete this.listeners[watchId];
+ } else {
+ throw new WebAPIException(WebAPIException.NOT_FOUND_ERR, 'Specified listener does not exist');
}
if (this.nativeSet && T.isEmptyObject(this.listeners)) {