Tweak exception message

This commit is contained in:
Ryan Ernst 2015-08-18 10:35:37 -07:00
parent a0c41218ff
commit 2a57539a28
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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]"));
}
}
}