code: function (e, data) {
                  if (e.isDefaultPrevented()) {
                      return false;
                  }
                  var that = $(this).data('blueimp-fileupload') ||
                          $(this).data('fileupload'),
                      template,
                      deferred;
                  if (data.context) {
                      data.context.each(function (index) {
                          if (data.errorThrown !== 'abort') {
                              var file = data.files[index];
                              file.error = file.error || data.errorThrown ||
                                  data.i18n('unknownError');
                              deferred = that._addFinishedDeferreds();
                              that._transition($(this)).done(
                                  function () {
                                      var node = $(this);
                                      template = that._renderDownload([file])
                                          .replaceAll(node);
                                      that._forceReflow(template);
                                      that._transition(template).done(
                                          function () {
                                              data.context = $(this);
                                              that._trigger('failed', e, data);
                                              that._trigger('finished', e, data);
                                              deferred.resolve();
                                          }
                                      );
                                  }
                              );
                          } else {
                              deferred = that._addFinishedDeferreds();
                              that._transition($(this)).done(
                                  function () {
                                      $(this).remove();
                                      that._trigger('failed', e, data);
                                      that._trigger('finished', e, data);
                                      deferred.resolve();
                                  }
                              );
                          }
                      });
                  } else if (data.errorThrown !== 'abort') {
                      data.context = that._renderUpload(data.files)[
                          that.options.prependFiles ? 'prependTo' : 'appendTo'
                      ](that.options.filesContainer)
                          .data('data', data);
                      that._forceReflow(data.context);
                      deferred = that._addFinishedDeferreds();
                      that._transition(data.context).done(
                          function () {
                              data.context = $(this);
                              that._trigger('failed', e, data);
                              that._trigger('finished', e, data);
                              deferred.resolve();
                          }
                      );
                  } else {
                      that._trigger('failed', e, data);
                      that._trigger('finished', e, data);
                      that._addFinishedDeferreds().resolve();
                  }
              }
docs: Callback for failed (abort or error) uploads: