mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Merge pull request #28 from ascribe/AD-1340-add-details-video-upload-errors
Add additional logging to video upload errors
This commit is contained in:
commit
9d0b4fcd6e
@ -410,13 +410,15 @@ let ReactS3FineUploader = React.createClass({
|
||||
},
|
||||
|
||||
onComplete(id, name, res, xhr) {
|
||||
// there has been an issue with the server's connection
|
||||
if((xhr && xhr.status === 0) || res.error) {
|
||||
console.logGlobal(new Error(res.error || 'Complete was called but there wasn\t a success'), false, {
|
||||
// There has been an issue with the server's connection
|
||||
if (xhr && xhr.status === 0 && res.success) {
|
||||
console.logGlobal(new Error('Upload succeeded with a status code 0'), false, {
|
||||
files: this.state.filesToUpload,
|
||||
chunks: this.state.chunks
|
||||
chunks: this.state.chunks,
|
||||
xhr: this.getXhrErrorComment(xhr)
|
||||
});
|
||||
} else {
|
||||
// onError will catch any errors, so we can ignore them here
|
||||
} else if (!res.error || res.success) {
|
||||
let files = this.state.filesToUpload;
|
||||
|
||||
// Set the state of the completed file to 'upload successful' in order to
|
||||
@ -467,10 +469,11 @@ let ReactS3FineUploader = React.createClass({
|
||||
this.onError(null, null, err.message);
|
||||
},
|
||||
|
||||
onError(id, name, errorReason) {
|
||||
onError(id, name, errorReason, xhr) {
|
||||
console.logGlobal(errorReason, false, {
|
||||
files: this.state.filesToUpload,
|
||||
chunks: this.state.chunks
|
||||
chunks: this.state.chunks,
|
||||
xhr: this.getXhrErrorComment(xhr)
|
||||
});
|
||||
|
||||
this.props.setIsUploadReady(true);
|
||||
@ -480,6 +483,17 @@ let ReactS3FineUploader = React.createClass({
|
||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||
},
|
||||
|
||||
getXhrErrorComment(xhr) {
|
||||
if (xhr) {
|
||||
return {
|
||||
response: xhr.response,
|
||||
url: xhr.responseURL,
|
||||
status: xhr.status,
|
||||
statusText: xhr.statusText
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
isFileValid(file) {
|
||||
if(file.size > this.props.validation.sizeLimit) {
|
||||
|
||||
|
@ -8683,7 +8683,7 @@ qq.s3.RequestSigner = function(o) {
|
||||
options.log(errorMessage, "error");
|
||||
}
|
||||
|
||||
promise.failure(errorMessage);
|
||||
promise.failure(errorMessage, xhrOrXdr);
|
||||
}
|
||||
else {
|
||||
promise.success(response);
|
||||
@ -8815,7 +8815,7 @@ qq.s3.RequestSigner = function(o) {
|
||||
credentialsProvider.get().accessKey,
|
||||
credentialsProvider.get().sessionToken);
|
||||
}, function(errorMsg) {
|
||||
options.log("Attempt to update expired credentials apparently failed! Unable to sign request. ", "error");
|
||||
options.log("Attempt to update expired credentials apparently failed! Unable to sign request: " + errorMsg, "error");
|
||||
signatureEffort.failure("Unable to sign request - expired credentials.");
|
||||
});
|
||||
}
|
||||
@ -9629,8 +9629,8 @@ qq.s3.XhrUploadHandler = function(spec, proxy) {
|
||||
});
|
||||
|
||||
xhr.send(chunkData.blob);
|
||||
}, function() {
|
||||
promise.failure({error: "Problem signing the chunk!"}, xhr);
|
||||
}, function(errorMsg, xhr) {
|
||||
promise.failure({error: "Problem signing the chunk: " + errorMsg}, xhr);
|
||||
});
|
||||
|
||||
return promise;
|
||||
@ -9674,10 +9674,10 @@ qq.s3.XhrUploadHandler = function(spec, proxy) {
|
||||
uploadIdPromise.success(uploadId);
|
||||
promise.success(uploadId);
|
||||
},
|
||||
function(errorMsg) {
|
||||
function(errorMsg, xhr) {
|
||||
handler._getPersistableData(id).uploadId = null;
|
||||
promise.failure(errorMsg);
|
||||
uploadIdPromise.failure(errorMsg);
|
||||
promise.failure(errorMsg, xhr);
|
||||
uploadIdPromise.failure(errorMsg, xhr);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user