From 2a57539a285ab75f8bddbc859f743f45c69701c2 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 18 Aug 2015 10:35:37 -0700 Subject: [PATCH] Tweak exception message --- .../main/java/org/elasticsearch/plugins/PluginsService.java | 2 +- .../java/org/elasticsearch/plugins/PluginsServiceTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/plugins/PluginsService.java b/core/src/main/java/org/elasticsearch/plugins/PluginsService.java index 1947953c35d..c1dfd7403b9 100644 --- a/core/src/main/java/org/elasticsearch/plugins/PluginsService.java +++ b/core/src/main/java/org/elasticsearch/plugins/PluginsService.java @@ -210,7 +210,7 @@ public class PluginsService extends AbstractComponent { String oldPlugin = foundSettings.put(setting, plugin.v1().getName()); if (oldPlugin != null) { throw new IllegalArgumentException("Cannot have additional setting [" + setting + "] " + - "in plugin " + plugin.v1().getName() + ", already added in plugin " + oldPlugin); + "in plugin [" + plugin.v1().getName() + "], already added in plugin [" + oldPlugin + "]"); } } builder.put(settings); diff --git a/core/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java b/core/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java index 5b0ea2d4eb3..8a1c8b14693 100644 --- a/core/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java +++ b/core/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java @@ -78,8 +78,8 @@ public class PluginsServiceTests extends ESTestCase { } catch (IllegalArgumentException e) { String msg = e.getMessage(); assertTrue(msg, msg.contains("Cannot have additional setting [foo.bar]")); - assertTrue(msg, msg.contains("plugin additional-settings1")); - assertTrue(msg, msg.contains("plugin additional-settings2")); + assertTrue(msg, msg.contains("plugin [additional-settings1]")); + assertTrue(msg, msg.contains("plugin [additional-settings2]")); } } }