diff --git a/papaparse.js b/papaparse.js index 7a7914a..fe11b81 100644 --- a/papaparse.js +++ b/papaparse.js @@ -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); } } diff --git a/player/player.js b/player/player.js index 91fc1a6..cdee0da 100644 --- a/player/player.js +++ b/player/player.js @@ -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) rows += results.data.length; } +function errorFn(error, file) +{ + console.log("ERROR:", error, file); +} + function completeFn() { end = performance.now();