nodejitsu/node-cloudfiles — Issue #23: destroyFile() isn't calling callback on failure
Author: kainosnoema
Created: 2011-12-12 19:12:04+00:00
State: open

For some reason `destroyFile()` wasn't calling my callback when it failed (ie. 404 Item not found), so digging into the code a bit I noticed that its [not passing an error callback to `common.rackspace()`](https://github.com/nodejitsu/node-cloudfiles/blob/master/lib/cloudfiles/core.js#L387-391).

Simple adding the callback before the last argument seems to work for me. If this is acceptable I'll be happy to open a pull request:

````js

Cloudfiles.prototype.destroyFile = function (container, file, callback) {
common.rackspace('DELETE', this.storageUrl(container, file), this, callback, function (body, res) {
callback(null, true);
});
};

````