Pārlūkot izejas kodu

Revert unrelated change with hard to predict consequences

Renée Kooi 6 gadi atpakaļ
vecāks
revīzija
372623867a
1 mainītis faili ar 7 papildinājumiem un 6 dzēšanām
  1. 7 6
      packages/@uppy/core/src/index.js

+ 7 - 6
packages/@uppy/core/src/index.js

@@ -1138,6 +1138,13 @@ class Uppy {
       })
     })
 
+    // Not returning the `catch`ed promise, because we still want to return a rejected
+    // promise from this method if the upload failed.
+    lastStep.catch((err) => {
+      this.emit('error', err, uploadID)
+      this._removeUpload(uploadID)
+    })
+
     return lastStep.then(() => {
       // Set result data.
       const { currentUploads } = this.getState()
@@ -1165,12 +1172,6 @@ class Uppy {
       this._removeUpload(uploadID)
 
       return result
-    }, (err) => {
-      this.emit('error', err, uploadID)
-
-      this._removeUpload(uploadID)
-
-      throw err
     })
   }