1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

Add xhr details to sentry logging

FineUploader’s s3.XhrUploadHandler was also fixed to pass down the xhr
object when initiating a multipart upload fails.
This commit is contained in:
Brett Sun 2015-11-13 16:16:54 +01:00
parent 66a38314e3
commit 8db531fb87
2 changed files with 15 additions and 7 deletions

View File

@ -456,11 +456,19 @@ let ReactS3FineUploader = React.createClass({
}
},
onError(id, name, errorReason) {
console.logGlobal(errorReason, false, {
onError(id, name, errorReason, xhr) {
const errorComment = {
files: this.state.filesToUpload,
chunks: this.state.chunks
});
chunks: this.state.chunks,
};
if (xhr) {
errorComment.xhr = {
response: xhr.response,
status: xhr.status,
statusText: xhr.statusText
};
}
console.logGlobal(errorReason, false, errorComment);
this.cancelUploads();

View File

@ -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);
}
);
}