TUS: handle remaining locked file error messages
This commit is contained in:
parent
605a8f371d
commit
eb83a834a1
1 changed files with 5 additions and 6 deletions
|
@ -76,13 +76,12 @@ export function makeResumableUploadRequest(
|
||||||
},
|
},
|
||||||
onError: (err) => {
|
onError: (err) => {
|
||||||
const status = err.originalResponse ? err.originalResponse.getStatus() : 0;
|
const status = err.originalResponse ? err.originalResponse.getStatus() : 0;
|
||||||
if (status === STATUS_CONFLICT || status === STATUS_LOCKED) {
|
const errMsg = typeof err === 'string' ? err : err.message;
|
||||||
|
|
||||||
|
if (status === STATUS_CONFLICT || status === STATUS_LOCKED || errMsg === 'file currently locked') {
|
||||||
window.store.dispatch(doUpdateUploadProgress({ params, status: 'conflict' }));
|
window.store.dispatch(doUpdateUploadProgress({ params, status: 'conflict' }));
|
||||||
reject(
|
// prettier-ignore
|
||||||
new Error(
|
reject(new Error(`${status}: concurrent upload detected. Uploading the same file from multiple tabs or windows is not allowed.`));
|
||||||
`${status}: concurrent upload detected. Uploading the same file from multiple tabs or windows is not allowed.`
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
window.store.dispatch(doUpdateUploadProgress({ params, status: 'error' }));
|
window.store.dispatch(doUpdateUploadProgress({ params, status: 'error' }));
|
||||||
reject(new Error(err));
|
reject(new Error(err));
|
||||||
|
|
Loading…
Reference in a new issue