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

Requirement conflicts could be better communicated #6353

Open
bovlb opened this issue Feb 8, 2024 · 0 comments
Open

Requirement conflicts could be better communicated #6353

bovlb opened this issue Feb 8, 2024 · 0 comments
Labels
component: command-based WPILib Command Based Library type: fix Iterations on existing features or infrastructure.

Comments

@bovlb
Copy link
Contributor

bovlb commented Feb 8, 2024

"Multiple commands in a parallel composition cannot require the same subsystems");

Traditionally, it was fairly easy to track down problems with conflicting requirements just by looking at the back trace. With modern tools (e.g. PathPlanner) that create commands for you, it can be much harder. (See related issue mjansen4857/pathplanner#601)

I suggest that this exception message be augmented to include the name of the command, the name of the command being added, and the names of the subsystems in conflict. Perhaps something like:

throw new IllegalArgumentException(
  String.format("Problem adding command %s to %s because subsystems %s are already required.  " 
    + "Multiple commands in a parallel composition cannot require the same subsystems", 
    command.getName(), this.getName(), requirementsIntersectionString(command.getRequirements()));
@calcmogul calcmogul added component: command-based WPILib Command Based Library type: fix Iterations on existing features or infrastructure. labels Mar 8, 2024
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 type: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

No branches or pull requests

2 participants