mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 01:25:17 +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) {
|
||||
const errorComment = {
|
||||
console.logGlobal(errorReason, false, {
|
||||
files: this.state.filesToUpload,
|
||||
chunks: this.state.chunks,
|
||||
};
|
||||
if (xhr) {
|
||||
errorComment.xhr = {
|
||||
response: xhr.response,
|
||||
status: xhr.status,
|
||||
statusText: xhr.statusText
|
||||
};
|
||||
}
|
||||
console.logGlobal(errorReason, false, errorComment);
|
||||
xhr: this.getXhrErrorComment(xhr)
|
||||
});
|
||||
|
||||
this.cancelUploads();
|
||||
|
||||
@ -476,6 +469,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;
|
||||
|
Loading…
Reference in New Issue
Block a user