diff --git a/commands2/parallelcommandgroup.py b/commands2/parallelcommandgroup.py index 897e5ab..1a27779 100644 --- a/commands2/parallelcommandgroup.py +++ b/commands2/parallelcommandgroup.py @@ -49,8 +49,13 @@ def addCommands(self, *commands: Command): for command in commands: in_common = command.getRequirements().intersection(self.requirements) if in_common: + requirements_str = ", ".join( + [s.getName() for s in in_common] + ) raise IllegalCommandUse( - "Multiple commands in a parallel composition cannot require the same subsystems.", + f"Command {command.getName()} could not be added to this ParallelCommandGroup" + f" because the subsystems [{requirements_str}] are already required in this command." + f" Multiple commands in a parallel composition cannot require the same subsystems.", common=in_common, ) diff --git a/commands2/paralleldeadlinegroup.py b/commands2/paralleldeadlinegroup.py index 6a06cef..7fb4f9a 100644 --- a/commands2/paralleldeadlinegroup.py +++ b/commands2/paralleldeadlinegroup.py @@ -85,8 +85,13 @@ def addCommands(self, *commands: Command): for command in commands: in_common = command.getRequirements().intersection(self.requirements) if in_common: + requirements_str = ", ".join( + [s.getName() for s in in_common] + ) raise IllegalCommandUse( - "Multiple commands in a parallel composition cannot require the same subsystems.", + f"Command {command.getName()} could not be added to this ParallelCommandGroup" + f" because the subsystems [{requirements_str}] are already required in this command." + f" Multiple commands in a parallel composition cannot require the same subsystems.", common=in_common, ) diff --git a/commands2/parallelracegroup.py b/commands2/parallelracegroup.py index 032003d..04f2112 100644 --- a/commands2/parallelracegroup.py +++ b/commands2/parallelracegroup.py @@ -51,8 +51,13 @@ def addCommands(self, *commands: Command): for command in commands: in_common = command.getRequirements().intersection(self.requirements) if in_common: + requirements_str = ", ".join( + [s.getName() for s in in_common] + ) raise IllegalCommandUse( - "Multiple commands in a parallel composition cannot require the same subsystems.", + f"Command {command.getName()} could not be added to this ParallelCommandGroup" + f" because the subsystems [{requirements_str}] are already required in this command." + f" Multiple commands in a parallel composition cannot require the same subsystems.", common=in_common, )