mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
Log additional details when chunk signing fails
This commit is contained in:
parent
8db531fb87
commit
1b4bf58129
@ -457,18 +457,11 @@ let ReactS3FineUploader = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onError(id, name, errorReason, xhr) {
|
onError(id, name, errorReason, xhr) {
|
||||||
const errorComment = {
|
console.logGlobal(errorReason, false, {
|
||||||
files: this.state.filesToUpload,
|
files: this.state.filesToUpload,
|
||||||
chunks: this.state.chunks,
|
chunks: this.state.chunks,
|
||||||
};
|
xhr: this.getXhrErrorComment(xhr)
|
||||||
if (xhr) {
|
});
|
||||||
errorComment.xhr = {
|
|
||||||
response: xhr.response,
|
|
||||||
status: xhr.status,
|
|
||||||
statusText: xhr.statusText
|
|
||||||
};
|
|
||||||
}
|
|
||||||
console.logGlobal(errorReason, false, errorComment);
|
|
||||||
|
|
||||||
this.cancelUploads();
|
this.cancelUploads();
|
||||||
|
|
||||||
@ -476,6 +469,17 @@ let ReactS3FineUploader = React.createClass({
|
|||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getXhrErrorComment(xhr) {
|
||||||
|
if (xhr) {
|
||||||
|
return {
|
||||||
|
response: xhr.response,
|
||||||
|
url: xhr.responseURL,
|
||||||
|
status: xhr.status,
|
||||||
|
statusText: xhr.statusText
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
isFileValid(file) {
|
isFileValid(file) {
|
||||||
if(file.size > this.props.validation.sizeLimit) {
|
if(file.size > this.props.validation.sizeLimit) {
|
||||||
|
|
||||||
|
@ -8683,7 +8683,7 @@ qq.s3.RequestSigner = function(o) {
|
|||||||
options.log(errorMessage, "error");
|
options.log(errorMessage, "error");
|
||||||
}
|
}
|
||||||
|
|
||||||
promise.failure(errorMessage);
|
promise.failure(errorMessage, xhrOrXdr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
promise.success(response);
|
promise.success(response);
|
||||||
@ -8815,7 +8815,7 @@ qq.s3.RequestSigner = function(o) {
|
|||||||
credentialsProvider.get().accessKey,
|
credentialsProvider.get().accessKey,
|
||||||
credentialsProvider.get().sessionToken);
|
credentialsProvider.get().sessionToken);
|
||||||
}, function(errorMsg) {
|
}, 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.");
|
signatureEffort.failure("Unable to sign request - expired credentials.");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -9629,8 +9629,8 @@ qq.s3.XhrUploadHandler = function(spec, proxy) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
xhr.send(chunkData.blob);
|
xhr.send(chunkData.blob);
|
||||||
}, function() {
|
}, function(errorMsg, xhr) {
|
||||||
promise.failure({error: "Problem signing the chunk!"}, xhr);
|
promise.failure({error: "Problem signing the chunk: " + errorMsg}, xhr);
|
||||||
});
|
});
|
||||||
|
|
||||||
return promise;
|
return promise;
|
||||||
|
Loading…
Reference in New Issue
Block a user