Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Reject the signing promises on failure. #1666

Merged
merged 1 commit into from
Sep 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions client/js/s3/request-signer.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ qq.s3.RequestSigner = function(o) {
requestInfo.hashedContent = hashedContent;

promise.success(generateStringToSign(requestInfo));
}, function (err) {
promise.failure(err);
});
}
else {
Expand All @@ -424,6 +426,8 @@ qq.s3.RequestSigner = function(o) {

toBeSigned.signatureConstructor.getToSign(id).then(function(signatureArtifacts) {
signApiRequest(toBeSigned.signatureConstructor, signatureArtifacts.stringToSign, signatureEffort);
}, function (err) {
signatureEffort.failure(err);
});
}
// Form upload (w/ policy document)
Expand Down Expand Up @@ -514,6 +518,9 @@ qq.s3.RequestSigner = function(o) {
.withParams(params)
.withQueryParams(queryParams)
.send();
}, function (err) {
options.log("Failed to construct signature. ", "error");
signatureEffort.failure("Failed to construct signature.");
});
}
else {
Expand Down Expand Up @@ -600,6 +607,8 @@ qq.s3.RequestSigner = function(o) {
stringToSign: artifacts.toSign,
stringToSignRaw: artifacts.toSignRaw
});
}, function (err) {
promise.failure(err);
});

return promise;
Expand Down