Malformed REST create index causes the index to still be created, closes #1359.

This commit is contained in:
Shay Banon 2011-09-24 01:04:12 +03:00
parent d9d452a1ef
commit d954a93d9d
1 changed files with 8 additions and 3 deletions

View File

@ -29,7 +29,12 @@ import org.elasticsearch.common.settings.SettingsException;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.rest.*;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestChannel;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.XContentRestResponse;
import org.elasticsearch.rest.XContentThrowableRestResponse;
import org.elasticsearch.rest.action.support.RestXContentBuilder;
import java.io.IOException;
@ -79,8 +84,8 @@ public class RestCreateIndexAction extends BaseRestHandler {
channel.sendResponse(new XContentThrowableRestResponse(request, e));
} catch (IOException e1) {
logger.warn("Failed to send response", e1);
return;
}
return;
}
} else {
// its plain settings, parse and set them
@ -91,8 +96,8 @@ public class RestCreateIndexAction extends BaseRestHandler {
channel.sendResponse(new XContentThrowableRestResponse(request, BAD_REQUEST, new SettingsException("Failed to parse index settings", e)));
} catch (IOException e1) {
logger.warn("Failed to send response", e1);
return;
}
return;
}
}
}