Repository: cordova-plugin-file Updated Branches: refs/heads/master cbcd0f461 -> 41d418398
Update FileProxy.js Handle an encoding error Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/5d88898d Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/5d88898d Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/5d88898d Branch: refs/heads/master Commit: 5d88898dee86435a5e0a585909aeb4174adfc650 Parents: 21e1196 Author: Tanaka Yusuke <[email protected]> Authored: Wed Apr 2 18:18:42 2014 +0900 Committer: Tanaka Yusuke <[email protected]> Committed: Wed Apr 2 18:18:42 2014 +0900 ---------------------------------------------------------------------- src/windows8/FileProxy.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/5d88898d/src/windows8/FileProxy.js ---------------------------------------------------------------------- diff --git a/src/windows8/FileProxy.js b/src/windows8/FileProxy.js index e564626..0675cd3 100644 --- a/src/windows8/FileProxy.js +++ b/src/windows8/FileProxy.js @@ -157,7 +157,11 @@ module.exports = { return stream.readAsync(buffer, readSize, Windows.Storage.Streams.InputStreamOptions.none); }).done(function(buffer) { - win(Windows.Security.Cryptography.CryptographicBuffer.convertBinaryToString(encoding, buffer)); + try{ + win(Windows.Security.Cryptography.CryptographicBuffer.convertBinaryToString(encoding, buffer)); + } catch (e) { + fail && fail(FileError.ENCODING_ERR); + } },function() { fail && fail(FileError.NOT_FOUND_ERR); });
