Skip to content

Commit

Permalink
fix regression in shape/type of response when upload metadata POST fails
Browse files Browse the repository at this point in the history
  • Loading branch information
jebeck committed Oct 30, 2015
1 parent f0087a2 commit c6a4b0c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ module.exports = function (config, deps) {
if (err != null) {
return cb(err);
}
else if (res.error != null) {
// reshape client error response in the way the uploader currently expects
// for the minimum version check (may apply elsewhere too)
var clientError = {message: JSON.parse(res.text)};
clientError.message.reason = clientError.message.text;
return cb(_.omit(clientError, 'text'));
}
return cb(null,res.body);
});
},
Expand Down

0 comments on commit c6a4b0c

Please sign in to comment.