Browse Source

Error callback invoked on error during file read

pull/82/head
Matthew Holt 11 years ago
parent
commit
091ccffcb9
  1. 5
      papaparse.js
  2. 6
      player/player.js

5
papaparse.js

@ -221,6 +221,11 @@ @@ -221,6 +221,11 @@
if (isFunction(config.complete))
config.complete(results);
};
reader.onerror = function()
{
if (isFunction(config.error))
config.error(reader.error, _input);
};
reader.readAsText(_input, config.encoding);
}
}

6
player/player.js

@ -66,6 +66,7 @@ function buildConfig() @@ -66,6 +66,7 @@ function buildConfig()
worker: $('#worker').prop('checked'),
comments: $('#comments').val(),
complete: completeFn,
error: errorFn,
download: $('#download').prop('checked'),
keepEmptyRows: $('#keepEmptyRows').prop('checked'),
chunk: $('#chunk').prop('checked') ? chunkFn : undefined
@ -86,6 +87,11 @@ function chunkFn(results, file) @@ -86,6 +87,11 @@ function chunkFn(results, file)
rows += results.data.length;
}
function errorFn(error, file)
{
console.log("ERROR:", error, file);
}
function completeFn()
{
end = performance.now();

Loading…
Cancel
Save