Skip to content

Conversation

@Almighty-Satan
Copy link

Running this code

this.commandManager.command(this.commandManager.commandBuilder("test").literal("test2", "test3"));
this.commandManager.command(this.commandManager.commandBuilder("test").literal("test4", "test3"));

throws the following exception:

org.incendo.cloud.exception.AmbiguousNodeException: Ambiguous Node: test4 cannot be added as a child to test (All children: test2, test4)

The exception does not mention the name of the offending alias test3 at all, which makes searching for the cause tedious in projects that have a lot of commands with a lot of aliases. My project also allows users to define their own aliases, which makes the situation even more confusing. This PR aims to improve this message to make it immediately clear what the offending alias is. Running the same code now gives the following output:

org.incendo.cloud.exception.AmbiguousNodeException: Ambiguous Node: test4 cannot be added as a child to test because of ambiguous name test3 (All children: test2, test4)

This PR also adds an additional test case for duplicate aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant