[Filesystem] In case of error invoke callback instead of throwing an exception.
authorPawel Andruszkiewicz <p.andruszkie@samsung.com>
Thu, 2 Jul 2015 08:01:03 +0000 (10:01 +0200)
committerPawel Andruszkiewicz <p.andruszkie@samsung.com>
Thu, 2 Jul 2015 08:01:03 +0000 (10:01 +0200)
[Verification] TCT pass rate: 100%

Change-Id: I4b3986bd249ad1ebc1459eb50525ddd7d1a0f5bd
Signed-off-by: Pawel Andruszkiewicz <p.andruszkie@samsung.com>
src/filesystem/js/file_system_manager.js

index 0596075448e454179bfa0cd2b01eef28bdf45a7d..8bff86e8f42655711a9c3f5c70d1d0240ae2e602 100755 (executable)
@@ -77,7 +77,7 @@ FileSystemManager.prototype.resolve = function(location, onsuccess, onerror, mod
     var aStatObj = native_.getResultObject(result);
     var _result = commonFS_.getFileInfo(aStatObj, false, args.mode);
     if (_result.readOnly && args.mode !== 'r') {
-      throw new WebAPIException(WebAPIException.IO_ERR);
+      native_.callIfPossible(args.onerror, new WebAPIException(WebAPIException.IO_ERR, 'File is read-only.'));
     } else {
       native_.callIfPossible(args.onsuccess, new File(_result));
     }