|
@@ -232,7 +232,7 @@ module.exports = class Tus extends Plugin {
|
|
|
}))
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- if (res.status < 200 && res.status > 300) {
|
|
|
+ if (res.status < 200 || res.status > 300) {
|
|
|
return reject(res.statusText)
|
|
|
}
|
|
|
|
|
@@ -289,6 +289,10 @@ module.exports = class Tus extends Plugin {
|
|
|
|
|
|
socket.on('progress', (progressData) => emitSocketProgress(this, progressData, file))
|
|
|
|
|
|
+ socket.on('error', (errData) => {
|
|
|
+ this.core.emitter.emit('core:upload-error', file.id, new Error(errData.error))
|
|
|
+ })
|
|
|
+
|
|
|
socket.on('success', (data) => {
|
|
|
this.core.emitter.emit('core:upload-success', file.id, data, data.url)
|
|
|
this.resetUploaderReferences(file.id)
|