tus,xhr-upload: emit error when companion returns error during upload creation (#2166)

This commit is contained in:
Ifedapo .A. Olarewaju 2020-04-01 21:14:45 +01:00 committed by GitHub
parent 89c04b8516
commit 7d972e09a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -338,7 +338,8 @@ module.exports = class Tus extends Plugin {
}).then(() => {
resolve()
}).catch((err) => {
reject(new Error(err))
this.uppy.emit('upload-error', file, err)
reject(err)
})
})
}

View file

@ -431,6 +431,9 @@ module.exports = class XHRUpload extends Plugin {
return () => socket.close()
})
}).catch((err) => {
this.uppy.emit('upload-error', file, err)
reject(err)
})
})
}