$body['records'] is only defined if entering the if clause and therefore the count on line 349 can cause undefined index errors
All bulk handlers and the bulk uploader now use a common HTTPBulkToolsResponse to return a common json format and handle errors. The front end uses this json to update the drifield accordingling.