|
@@ -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
|
|
|
})
|
|
|
}
|
|
|
|