Improve error message when commands fail to be added and make commands using the new system check for masking (#1404)

* Improve error message when command already exists

* Add app's name to the message

* Add app name to any command load failure and fix commands from new system masking existing ones

* Fix duplicated app name in an error

* Update to recent snapshot changes
This commit is contained in:
altrisi authored and GitHub committed 2022-06-27 14:09:03 +02:00
1 parent 286dbead14
commit 41991b0346
2 files changed
+9 -4

No files matched your search

@@ -295,9 +295,9 @@ public class CarpetScriptServer extends ScriptServer
//addEvents(source, name);
String action = (installer!=null)?(reload?"reinstalled":"installed"):(reload?"reloaded":"loaded");
String finalName = name;
Boolean isCommandAdded = newHost.addAppCommands(s -> {
if (!isRuleApp) Messenger.m(source, s);
if (!isRuleApp) Messenger.m(source, Messenger.c("r Failed to add app '" + finalName + "': ", s));
});
if (isCommandAdded == null) // error should be dispatched
{