Fix error callback when deleting file

This commit is contained in:
Thomas Kluyver 2014-10-29 11:08:01 -07:00
parent 9797a6b7c0
commit b8f9dc07e2

View File

@ -112,7 +112,7 @@ define([
};
Contents.prototype.delete_file = function(name, path, options) {
var error = options.error || function() {};
var error_callback = options.error || function() {};
var that = this;
var settings = {
processData : false,
@ -124,9 +124,9 @@ define([
// TODO: update IPEP27 to specify errors more precisely, so
// that error types can be detected here with certainty.
if (xhr.status === 400) {
error(new Contents.DirectoryNotEmptyError());
error_callback(new Contents.DirectoryNotEmptyError());
}
error(utils.wrap_ajax_error(xhr, status, error));
error_callback(utils.wrap_ajax_error(xhr, status, error));
}
};
var url = this.api_url(path, name);