diff --git a/core/src/main/java/org/elasticsearch/cluster/metadata/AutoExpandReplicas.java b/core/src/main/java/org/elasticsearch/cluster/metadata/AutoExpandReplicas.java index 2b9ec71299f..eacde5f9241 100644 --- a/core/src/main/java/org/elasticsearch/cluster/metadata/AutoExpandReplicas.java +++ b/core/src/main/java/org/elasticsearch/cluster/metadata/AutoExpandReplicas.java @@ -37,13 +37,13 @@ final class AutoExpandReplicas { } final int dash = value.indexOf('-'); if (-1 == dash) { - throw new IllegalArgumentException("failed to parse [" + IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS + "] form [" + value + "] at index " + dash); + throw new IllegalArgumentException("failed to parse [" + IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS + "] from value: [" + value + "] at index " + dash); } final String sMin = value.substring(0, dash); try { min = Integer.parseInt(sMin); } catch (NumberFormatException e) { - throw new IllegalArgumentException("failed to parse [" + IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS + "] form [" + value + "] at index " + dash, e); + throw new IllegalArgumentException("failed to parse [" + IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS + "] from value: [" + value + "] at index " + dash, e); } String sMax = value.substring(dash + 1); if (sMax.equals(ALL_NODES_VALUE)) { @@ -52,7 +52,7 @@ final class AutoExpandReplicas { try { max = Integer.parseInt(sMax); } catch (NumberFormatException e) { - throw new IllegalArgumentException("failed to parse [" + IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS + "] form [" + value + "] at index " + dash, e); + throw new IllegalArgumentException("failed to parse [" + IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS + "] from value: [" + value + "] at index " + dash, e); } } return new AutoExpandReplicas(min, max, true); diff --git a/core/src/test/java/org/elasticsearch/cluster/metadata/AutoExpandReplicasTests.java b/core/src/test/java/org/elasticsearch/cluster/metadata/AutoExpandReplicasTests.java index 32de58b9e0d..32312f34e21 100644 --- a/core/src/test/java/org/elasticsearch/cluster/metadata/AutoExpandReplicasTests.java +++ b/core/src/test/java/org/elasticsearch/cluster/metadata/AutoExpandReplicasTests.java @@ -46,14 +46,14 @@ public class AutoExpandReplicasTests extends ESTestCase { AutoExpandReplicas.SETTING.get(Settings.builder().put("index.auto_expand_replicas", "boom").build()); fail(); } catch (IllegalArgumentException ex) { - assertEquals("failed to parse [index.auto_expand_replicas] form [boom] at index -1", ex.getMessage()); + assertEquals("failed to parse [index.auto_expand_replicas] from value: [boom] at index -1", ex.getMessage()); } try { AutoExpandReplicas.SETTING.get(Settings.builder().put("index.auto_expand_replicas", "1-boom").build()); fail(); } catch (IllegalArgumentException ex) { - assertEquals("failed to parse [index.auto_expand_replicas] form [1-boom] at index 1", ex.getMessage()); + assertEquals("failed to parse [index.auto_expand_replicas] from value: [1-boom] at index 1", ex.getMessage()); assertEquals("For input string: \"boom\"", ex.getCause().getMessage()); } @@ -61,7 +61,7 @@ public class AutoExpandReplicasTests extends ESTestCase { AutoExpandReplicas.SETTING.get(Settings.builder().put("index.auto_expand_replicas", "boom-1").build()); fail(); } catch (IllegalArgumentException ex) { - assertEquals("failed to parse [index.auto_expand_replicas] form [boom-1] at index 4", ex.getMessage()); + assertEquals("failed to parse [index.auto_expand_replicas] from value: [boom-1] at index 4", ex.getMessage()); assertEquals("For input string: \"boom\"", ex.getCause().getMessage()); }