-
Notifications
You must be signed in to change notification settings - Fork 338
Open
Labels
Description
Describe the bug
My Tus server with its onUploadFinish hook will save a successful upload into the database and will wipe out the file locally. The thing is the user, on the frontend, may need to remove it from its list using:
uppy.removeFile(file.id);But it triggers the error:
Uncaught (in promise) DetailedError: tus: unexpected response while terminating upload, originated from request (method: DELETE, url: http://localhost:3000/api/upload/9a029a4f-ddf0-46c5-a52d-c281e0ef2e2b, response code: 404, response text: The file for this url was not found
, request id: n/a)
Originally triggered from
Lines 1199 to 1204 in fe0cf9e
| throw new DetailedError( | |
| 'tus: unexpected response while terminating upload', | |
| undefined, | |
| req, | |
| res, | |
| ) |
The error 404 is part of the protocol so it's fine. I'm just here about the fact it's uncaught despite using Uppy listener on error event, and also using:
uppy.use(Tus, {
...
onError: (error) => {
console.log(error);
},
});
Nothing from tus-js-client (and @uppy/tus using same parameters) is catching it.
To Reproduce
Use an Uppy with Tus plugin, and trigger uppy.removeFile(id) that will call the terminate() from tus-js-client.