Skip to content

Commit

Permalink
Added extra errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Jun 21, 2019
1 parent c58bdea commit 00d73d2
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion twitchio/ext/commands/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,36 @@
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""
"""


class TwitchCommandError(Exception):
pass


class InvalidCogMethod(TwitchCommandError):
pass


class MissingRequiredArgument(TwitchCommandError):
pass


class BadArgument(TwitchCommandError):
pass


class CommandNotFound(TwitchCommandError):
pass


class CommandOnCooldown(TwitchCommandError):

def __init__(self, command, retry_after):
self.command = command
self.retry_after = retry_after
super().__init__(f'Command <{command.name}> is on cooldown. Try again in ({retry_after:.2f})s')


class CheckFailure(TwitchCommandError):
pass

0 comments on commit 00d73d2

Please sign in to comment.