 
   # Called internally when processing is finished.
   # Individual callbacks have to be called in the appropriate sections.
-  errorProcessing: (file, message) ->
+  errorProcessing: (file, message, xhr) ->
     @filesProcessing = without(@filesProcessing, file)
     file.processing = no
     @processQueue()
-    @emit "error", file, message
+    @emit "error", file, message, xhr
     @emit "complete", file
 
 

    xhr.open @options.method, @options.url, true

    handleError = =>
      @errorProcessing file, xhr.responseText || "Server responded with #{xhr.status} code."

    xhr.onload = (e) =>
      unless 200 <= xhr.status < 300

    # If the file doesn't match the file type.
    dictInvalidFileType: "You can't upload files of this type."

    # If the server response was invalid.
    dictResponseError: "Server responded with {{statusCode}} code."

    # If `done()` is called without argument the file is accepted
    # If you call it with an error message, the file is rejected
