I am using a TUS backend.
When trying to capture the error using uppy.on("upload-error")
. upload-error
is emitted twice for the same error, while we expect uppy to only report the error once.
Once here - link to uppy code:
uploadOptions.onError = (err) => {
this.uppy.log(err)
const xhr =
(err as tus.DetailedError).originalRequest != null ?
(err as tus.DetailedError).originalRequest.getUnderlyingObject()
: null
if (isNetworkError(xhr)) {
// eslint-disable-next-line no-param-reassign
err = new NetworkError(err, xhr)
}
this.resetUploaderReferences(file.id)
queuedRequest?.abort()
this.uppy.emit('upload-error', file, err)
if (typeof opts.onError === 'function') {
opts.onError(err)
}
reject(err)
}
and once here - link to uppy code:
}).catch((err) => {
this.uppy.emit('upload-error', file, err)
throw err
})