More tus logging (#659)
This commit is contained in:
commit
e6a21dc14f
1 changed files with 3 additions and 2 deletions
|
@ -72,6 +72,7 @@ export function makeResumableUploadRequest(
|
||||||
onShouldRetry: (err, retryAttempt, options) => {
|
onShouldRetry: (err, retryAttempt, options) => {
|
||||||
window.store.dispatch(doUpdateUploadProgress({ guid, status: 'retry' }));
|
window.store.dispatch(doUpdateUploadProgress({ guid, status: 'retry' }));
|
||||||
const status = err.originalResponse ? err.originalResponse.getStatus() : 0;
|
const status = err.originalResponse ? err.originalResponse.getStatus() : 0;
|
||||||
|
analytics.error(`tus: retry=${uploader._retryAttempt}, status=${status}`);
|
||||||
return !inStatusCategory(status, 400);
|
return !inStatusCategory(status, 400);
|
||||||
},
|
},
|
||||||
onError: (err) => {
|
onError: (err) => {
|
||||||
|
@ -85,13 +86,13 @@ export function makeResumableUploadRequest(
|
||||||
} else {
|
} else {
|
||||||
window.store.dispatch(doUpdateUploadProgress({ guid, status: 'error' }));
|
window.store.dispatch(doUpdateUploadProgress({ guid, status: 'error' }));
|
||||||
reject(
|
reject(
|
||||||
// $FlowFixMe - flow's contructor for Error is incorrect.
|
// $FlowFixMe - flow's constructor for Error is incorrect.
|
||||||
new Error(err, {
|
new Error(err, {
|
||||||
cause: {
|
cause: {
|
||||||
url: uploader.url,
|
url: uploader.url,
|
||||||
|
status,
|
||||||
...(uploader._fingerprint ? { fingerprint: uploader._fingerprint } : {}),
|
...(uploader._fingerprint ? { fingerprint: uploader._fingerprint } : {}),
|
||||||
...(uploader._retryAttempt ? { retryAttempt: uploader._retryAttempt } : {}),
|
...(uploader._retryAttempt ? { retryAttempt: uploader._retryAttempt } : {}),
|
||||||
...(uploader._retryTimeout ? { retryTimeout: uploader._retryTimeout } : {}),
|
|
||||||
...(uploader._offsetBeforeRetry ? { offsetBeforeRetry: uploader._offsetBeforeRetry } : {}),
|
...(uploader._offsetBeforeRetry ? { offsetBeforeRetry: uploader._offsetBeforeRetry } : {}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue