I've been grappling with this issue for quite some time now.
I'm utilizing angularjs ui grid along with Django.
Take a look at the code snippet below found in the html:
<div ui-grid="gridOptions" class="grid" ui-grid-importer
ui-grid-row-edit ui-grid-edit ui-grid-cellNav ui-grid-resize-columns
ui-grid-auto-resize ui-grid-move-columns
ui-grid-pagination ui-grid-exporter >
</div>
Pay attention to ui-grid-importer.
I aim to display an error message to the user when there is a failed import attempt, like trying to import a file that is not a CSV.
The error I encounter reads as follows:
uncaught exception: UNEXPECTED_END_OF_RECORD at char...
In controller.js...
Within $scope.gridOptions = {
importerErrorCallback: function( grid, errorKey, consoleMessage, context ) {
console.log(errorKey);
console.log(importer.invalidCsv);
myUserDisplayRoutine( errorKey );
myLoggingRoutine( consoleMessage, context );
alert("in error callback")
},
Even prior to reaching this code block, I face the unexpected_end_of_record error.
The documentation link I referred to: