Notify: Disable retry + try to report status code
This commit is contained in:
parent
d047a748b7
commit
9bfa1a3577
1 changed files with 2 additions and 2 deletions
|
@ -56,7 +56,7 @@ export function makeResumableUploadRequest(
|
||||||
window.store.dispatch(doUpdateUploadProgress({ params, progress: percentage }));
|
window.store.dispatch(doUpdateUploadProgress({ params, progress: percentage }));
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
let retries = 2;
|
let retries = 0;
|
||||||
|
|
||||||
function makeNotifyRequest() {
|
function makeNotifyRequest() {
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
|
@ -75,7 +75,7 @@ export function makeResumableUploadRequest(
|
||||||
setTimeout(() => makeNotifyRequest(), 10000);
|
setTimeout(() => makeNotifyRequest(), 10000);
|
||||||
} else {
|
} else {
|
||||||
window.store.dispatch(doUpdateUploadProgress({ params, status: 'error' }));
|
window.store.dispatch(doUpdateUploadProgress({ params, status: 'error' }));
|
||||||
reject(new Error(__('There was a problem in the processing. Please retry.')));
|
reject(new Error(`There was a problem in the processing. Please retry. (${xhr.status})`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhr.onabort = () => {
|
xhr.onabort = () => {
|
||||||
|
|
Loading…
Reference in a new issue