mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Add possible command exceptions
This commit is contained in:
parent
836ac46261
commit
144ff53752
2 changed files with 12 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
from .asyncify import asyncify
|
from .asyncify import asyncify
|
||||||
from .call import Call
|
from .call import Call
|
||||||
from .command import Command
|
from .command import Command, InvalidInputError, UnsupportedError
|
||||||
from .safeformat import safeformat
|
from .safeformat import safeformat
|
||||||
|
|
||||||
__all__ = ["asyncify", "Call", "Command", "safeformat"]
|
__all__ = ["asyncify", "Call", "Command", "safeformat", "InvalidInputError", "UnsupportedError"]
|
||||||
|
|
|
@ -3,6 +3,16 @@ if typing.TYPE_CHECKING:
|
||||||
from .call import Call
|
from .call import Call
|
||||||
|
|
||||||
|
|
||||||
|
class UnsupportedError(Exception):
|
||||||
|
"""The command is not supported for the specified source."""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class InvalidInputError(Exception):
|
||||||
|
"""The command has received invalid input and cannot complete."""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Command:
|
class Command:
|
||||||
"""A generic command, called from any source."""
|
"""A generic command, called from any source."""
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue