|
@@ -19,6 +19,7 @@ function defaultGetAssemblyOptions (file, options) {
|
|
|
const sendErrorToConsole = originalErr => err => {
|
|
|
const error = new Error('Failed to send error to the client')
|
|
|
error.cause = err
|
|
|
+
|
|
|
console.error(error, originalErr)
|
|
|
}
|
|
|
|
|
@@ -242,7 +243,7 @@ module.exports = class Transloadit extends BasePlugin {
|
|
|
})
|
|
|
|
|
|
watcher.on('assembly-error', (id, error) => {
|
|
|
-
|
|
|
+
|
|
|
const files = this.getAssemblyFiles(id)
|
|
|
files.forEach((file) => {
|
|
|
|
|
@@ -708,10 +709,9 @@ module.exports = class Transloadit extends BasePlugin {
|
|
|
}
|
|
|
|
|
|
#onTusError = (err) => {
|
|
|
- if (err && /^tus: /.test(err.message)) {
|
|
|
- const xhr = err.originalRequest ? err.originalRequest.getUnderlyingObject() : null
|
|
|
- const url = xhr && xhr.responseURL ? xhr.responseURL : null
|
|
|
- this.client.submitError(err, { url, type: 'TUS_ERROR' })
|
|
|
+ if (err?.message?.startsWith('tus: ')) {
|
|
|
+ const endpoint = err.originalRequest?.getUnderlyingObject()?.responseURL
|
|
|
+ this.client.submitError(err, { endpoint, type: 'TUS_ERROR' })
|
|
|
|
|
|
.catch(sendErrorToConsole(err))
|
|
|
}
|