robotpy/robotpy-commands-v2

Provide better error messages in IllegalCommandUse exceptions

Closed this issue · 0 comments

Things like

raise IllegalCommandUse(
                f"The deadline command cannot also be in the other commands!"
            )

Are fine, but not particularly user-friendly. I understand why Java/C++ don't do the friendly thing, but we can do better. Maybe something like?

raise IllegalCommandUse("message", deadline=deadline)

And have the constructor take msg, **kwargs, and append ", ".join(f"{k}={v!r}" for k, v in kwargs.items())?

Might do in #46, we'll see.