[filesystem] Silence undocumented exception. 07/196107/1
authorMichal Michalski <m.michalski2@partner.samsung.com>
Fri, 21 Dec 2018 14:07:21 +0000 (15:07 +0100)
committerMichal Michalski <m.michalski2@partner.samsung.com>
Fri, 21 Dec 2018 14:42:00 +0000 (15:42 +0100)
Filesystem function removeStorageStateChangeListener was throwing
NotFoundError exception if watchID argument did not correspond to
a registered listener. This commit removes this exception to match
documentation.

[Verification]

Exception is no longer thrown.
One TCT test case failed after this change, i removed it and commited
the change to tct repository. Review for TCT is available here:
https://review.tizen.org/gerrit/#/c/test/tct/web/api/+/196106/

Change-Id: I8cb7d99b5dda3f66f36c406c86330fb5d089287f
Signed-off-by: Michal Michalski <m.michalski2@partner.samsung.com>
src/filesystem/js/file_system_manager.js

index 22f4ba2706ff28436eef4d8e808659913a578b7b..43e62a24b10f8a0e9e601d94a437352c6cd263b5 100644 (file)
@@ -728,7 +728,7 @@ function removeStorageStateChangeListener() {
   var id = args.watchId;
 
   if (type_.isNullOrUndefined(callbacks[id])) {
-    throw new WebAPIException(WebAPIException.NOT_FOUND_ERR, 'Watch ID not found.');
+    return;
   }
 
   delete callbacks[id];