blueimp/jQuery-File-Upload — pull request #3009 by nis-patel (2014-03-07 03:55:37+00:00)
Title: Throwing custom event for errors occurred while adding a file

// Line 124:
that._trigger('customnperror', e, data);

/**
In this plugin we can set various conditions/restrictions on file upload (e.g. acceptFileTypes, maxFileSize, maxNumberOfFiles, etc..)
Whenever a file is added, an event is fired "fileuploadadd" and once the file is added successfully another event is fired "fileuploadadded".
However, when a file is added and it fails one of these condition/restriction (e.g. user tries to upload 2GB file, or text file instead of an image), there is no way find out programatically that this has occurred.
While uploading a file if an error occurs then I have added a code to throw custom error named "adderror", so that we can bind this event and track errors.
**/