Browse Source

[update] XHR complete object passes as argument in order to have the payload of the request and the error code.

Jagoba 8 years ago
parent
commit
8fec33de43
1 changed files with 1 additions and 6 deletions
  1. 1 6
      src/plugins/Multipart.js

+ 1 - 6
src/plugins/Multipart.js

@@ -62,12 +62,7 @@ export default class Multipart extends Plugin {
           this.core.log(`Download ${file.name} from ${file.uploadURL}`)
           return resolve(file)
         } else {
-          // OPTION 1: return the full XHR object
-          this.core.emitter.emit('core:upload-error', file.id, xhr);
-
-          // OPTION 2: return the payload of the XHR object
-          this.core.emitter.emit('core:upload-error', file.id, xhr.response);
-
+          this.core.emitter.emit('core:upload-error', file.id, xhr)
           return reject('Upload error')
         }