Permalink
Browse files

return just error arg on delete methods

  • Loading branch information...
tellnes committed Apr 26, 2012
1 parent 9d25730 commit 721df5ab994f213272a179a8cd9458eb65b96c26
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/index.js
View
@@ -289,7 +289,9 @@ CloudFront.prototype.deleteDistribution = function(distribution, etag, opts, cb)
}
etag = String(etag.etag || etag);
- this.request('DELETE', (opts.streaming ? 'streaming-' : '') + 'distribution/' + distribution, {'If-Match': etag}, cb).end();
+ this.request('DELETE', (opts.streaming ? 'streaming-' : '') + 'distribution/' + distribution, {'If-Match': etag}, function(err, body, res) {
+ cb(err);
+ }).end();
};
CloudFront.prototype.listDistributions = function(opts, cb) {
@@ -762,7 +764,9 @@ CloudFrontOriginAccessIdentity.prototype.delete = function(cb) {
throw new Error('Missing etag. Did you use CloudFront#listOriginAccessIdentities?');
}
- this.client.request('DELETE', 'origin-access-identity/cloudfront/' + this.id, {'If-Match': this.etag}, cb).end();
+ this.client.request('DELETE', 'origin-access-identity/cloudfront/' + this.id, {'If-Match': this.etag}, function(err, body, res) {
+ cb(err);
+ }).end();
};
function createClient(key, secret) {

0 comments on commit 721df5a

Please sign in to comment.