improve exception message

This commit is contained in:
Simon Willnauer 2015-10-22 20:09:31 +02:00
parent db87594bca
commit 76c660ba93
2 changed files with 3 additions and 3 deletions

View File

@ -73,7 +73,7 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
protected void doExecute(CloseIndexRequest request, ActionListener<CloseIndexResponse> listener) { protected void doExecute(CloseIndexRequest request, ActionListener<CloseIndexResponse> listener) {
destructiveOperations.failDestructive(request.indices()); destructiveOperations.failDestructive(request.indices());
if (closeIndexEnabled == false) { if (closeIndexEnabled == false) {
throw new IllegalStateException("closing indices is disabled - set [" + SETTING_CLUSTER_INDICES_CLOSE_ENABLE + ": true] to enable it. NOTE: closed indices consume a significant amount of diskspace"); throw new IllegalStateException("closing indices is disabled - set [" + SETTING_CLUSTER_INDICES_CLOSE_ENABLE + ": true] to enable it. NOTE: closed indices still consume a significant amount of diskspace");
} }
super.doExecute(request, listener); super.doExecute(request, listener);
} }

View File

@ -35,7 +35,7 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcke
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.notNullValue;
@ClusterScope(scope= Scope.TEST, numDataNodes =2) @ClusterScope(scope=Scope.TEST, numDataNodes=2)
public class CloseIndexDisableCloseAllIT extends ESIntegTestCase { public class CloseIndexDisableCloseAllIT extends ESIntegTestCase {
@Test @Test
@ -100,7 +100,7 @@ public class CloseIndexDisableCloseAllIT extends ESIntegTestCase {
client.admin().indices().prepareClose("test_no_close").execute().actionGet(); client.admin().indices().prepareClose("test_no_close").execute().actionGet();
fail("exception expected"); fail("exception expected");
} catch (IllegalStateException ex) { } catch (IllegalStateException ex) {
assertEquals(ex.getMessage(), "closing indices is disabled - set [cluster.indices.close.enable: true] to enable it. NOTE: closed indices consume a significant amount of diskspace"); assertEquals(ex.getMessage(), "closing indices is disabled - set [cluster.indices.close.enable: true] to enable it. NOTE: closed indices still consume a significant amount of diskspace");
} }
} }