Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmd] Better error message/handling for composing duplicate commands in the same composition #6080

Closed
rzblue opened this issue Dec 22, 2023 · 2 comments · Fixed by #6091
Closed
Labels
component: command-based WPILib Command Based Library

Comments

@rzblue
Copy link
Member

rzblue commented Dec 22, 2023

Currently, composing the same command multiple times using constructors/factories will cause an IllegalArgumentException in CommandScheduler.registerComposedCommands due to set semantics. It's not immediately clear what caused it as the exception occurs multiple levels below the user's code.

We also should test this behavior - composing the same command twice should fail.

@rzblue rzblue added the component: command-based WPILib Command Based Library label Dec 22, 2023
@rzblue rzblue changed the title Better error message/handling for composing duplicate commands [cmd] Better error message/handling for composing duplicate commands Dec 22, 2023
@rzblue rzblue changed the title [cmd] Better error message/handling for composing duplicate commands [cmd] Better error message/handling for composing duplicate commands in the same composition Dec 22, 2023
@KangarooKoala
Copy link
Contributor

Additionally, ParallelDeadlineGroup should error if a command is both the deadline and registered separately.

@Starlight220
Copy link
Member

ParallelDeadlineGroup should error if a command is both the deadline and registered separately

The deadline is marked as composed separately from the other commands, so it does error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: command-based WPILib Command Based Library
Projects
None yet
3 participants