tus: Get more information from publish errors
This commit is contained in:
parent
555bde87f8
commit
01459d906a
2 changed files with 14 additions and 3 deletions
|
@ -281,7 +281,7 @@ export const doPublishDesktop = (filePath: string, preview?: boolean) => (dispat
|
|||
actions.push({
|
||||
type: ACTIONS.PUBLISH_FAIL,
|
||||
});
|
||||
actions.push(doError(error.message));
|
||||
actions.push(doError({ message: error.message, cause: error.cause }));
|
||||
dispatch(batchActions(...actions));
|
||||
};
|
||||
|
||||
|
@ -351,7 +351,7 @@ export const doPublishResume = (publishPayload: any) => (dispatch: Dispatch, get
|
|||
actions.push({
|
||||
type: ACTIONS.PUBLISH_FAIL,
|
||||
});
|
||||
actions.push(doError(error.message));
|
||||
actions.push(doError({ message: error.message, cause: error.cause }));
|
||||
dispatch(batchActions(...actions));
|
||||
};
|
||||
|
||||
|
|
|
@ -84,7 +84,18 @@ export function makeResumableUploadRequest(
|
|||
reject(new Error(`${status}: concurrent upload detected. Uploading the same file from multiple tabs or windows is not allowed.`));
|
||||
} else {
|
||||
window.store.dispatch(doUpdateUploadProgress({ guid, status: 'error' }));
|
||||
reject(new Error(err));
|
||||
reject(
|
||||
// $FlowFixMe - flow's contructor for Error is incorrect.
|
||||
new Error(err, {
|
||||
cause: {
|
||||
url: uploader.url,
|
||||
...(uploader._fingerprint ? { fingerprint: uploader._fingerprint } : {}),
|
||||
...(uploader._retryAttempt ? { retryAttempt: uploader._retryAttempt } : {}),
|
||||
...(uploader._retryTimeout ? { retryTimeout: uploader._retryTimeout } : {}),
|
||||
...(uploader._offsetBeforeRetry ? { offsetBeforeRetry: uploader._offsetBeforeRetry } : {}),
|
||||
},
|
||||
})
|
||||
);
|
||||
}
|
||||
},
|
||||
onProgress: (bytesUploaded, bytesTotal) => {
|
||||
|
|
Loading…
Reference in a new issue