We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dbdf4a6 + 71fd7e0 commit 01830f4Copy full SHA for 01830f4
1 file changed
lib/aws.js
@@ -118,10 +118,15 @@ var genericAWSClient = function(obj) {
118
res.addListener('end', function() {
119
var parser = new xml2js.Parser();
120
parser.addListener('end', function(result) {
121
- if (typeof result != "undefined" && typeof result.Errors != "undefined"){
122
- callback(new Error(result.Errors.Error.Message), result)
+ if (typeof result != "undefined") {
+ var err = result.Error || (result.Errors ? result.Errors.Error : null)
123
+ if (err) {
124
+ callback(new Error(err.Message), result)
125
+ } else {
126
+ callback(null, result)
127
+ }
128
} else {
- callback(null, result)
129
+ callback(new Error('Unable to parse XML from AWS.'))
130
}
131
});
132
parser.parseString(data);
0 commit comments