mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 17:10:15 +08:00
Ticket 127: Android FileReader/FileWriter methods should return FileError object on error.
This commit is contained in:
parent
ed4c57e791
commit
40084293c3
@ -244,7 +244,9 @@ FileReader.prototype.readAsText = function(file, encoding) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save error
|
// Save error
|
||||||
me.error = e;
|
var fileError = new FileError();
|
||||||
|
fileError.code = e;
|
||||||
|
me.error = fileError;
|
||||||
|
|
||||||
// If onerror callback
|
// If onerror callback
|
||||||
if (typeof me.onerror === "function") {
|
if (typeof me.onerror === "function") {
|
||||||
@ -326,7 +328,9 @@ FileReader.prototype.readAsDataURL = function(file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save error
|
// Save error
|
||||||
me.error = e;
|
var fileError = new FileError();
|
||||||
|
fileError.code = e;
|
||||||
|
me.error = fileError;
|
||||||
|
|
||||||
// If onerror callback
|
// If onerror callback
|
||||||
if (typeof me.onerror === "function") {
|
if (typeof me.onerror === "function") {
|
||||||
@ -501,7 +505,9 @@ FileWriter.prototype.write = function(text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save error
|
// Save error
|
||||||
me.error = e;
|
var fileError = new FileError();
|
||||||
|
fileError.code = e;
|
||||||
|
me.error = fileError;
|
||||||
|
|
||||||
// If onerror callback
|
// If onerror callback
|
||||||
if (typeof me.onerror === "function") {
|
if (typeof me.onerror === "function") {
|
||||||
@ -614,7 +620,9 @@ FileWriter.prototype.truncate = function(size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save error
|
// Save error
|
||||||
me.error = e;
|
var fileError = new FileError();
|
||||||
|
fileError.code = e;
|
||||||
|
me.error = fileError;
|
||||||
|
|
||||||
// If onerror callback
|
// If onerror callback
|
||||||
if (typeof me.onerror === "function") {
|
if (typeof me.onerror === "function") {
|
||||||
|
Loading…
Reference in New Issue
Block a user