mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[robotpy] Mirror robotpy's commands-v2 (#8369)
Project import generated by Copybara. GitOrigin-RevId: 715c8e8372d936f447f2937aab6b1a22dc619126
This commit is contained in:
19
commandsv2/src/main/python/commands2/exceptions.py
Normal file
19
commandsv2/src/main/python/commands2/exceptions.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# notrack
|
||||
|
||||
import typing
|
||||
|
||||
|
||||
class IllegalCommandUse(Exception):
|
||||
"""
|
||||
This exception is raised when a command is used in a way that it shouldn't be.
|
||||
|
||||
You shouldn't try to catch this exception, if it occurs it means your code is
|
||||
doing something it probably shouldn't be doing
|
||||
"""
|
||||
|
||||
def __init__(self, msg: str, **kwargs: typing.Any) -> None:
|
||||
if kwargs:
|
||||
args_repr = ", ".join(f"{k}={v!r}" for k, v in kwargs.items())
|
||||
msg = f"{msg} ({args_repr})"
|
||||
|
||||
super().__init__(msg)
|
||||
Reference in New Issue
Block a user