paper-dynasty-discord/exceptions.py
Cal Corum c3418c4dfd New show-card dropdown view
Added PlayInitException
Added complete_and_post_play for log commands
Added many more log plays
Add undo-play
Added query logging
2024-11-09 00:48:13 -06:00

41 lines
803 B
Python

import logging
from typing import Literal
def log_exception(e: Exception, msg: str = '', level: Literal['debug', 'error', 'info', 'warn'] = 'error'):
if level == 'debug':
logging.debug(msg, stack_info=True)
elif level == 'error':
logging.error(msg, stack_info=True)
elif level == 'info':
logging.info(msg, stack_info=True)
else:
logging.warning(msg, stack_info=True)
raise e(msg)
class GameException(Exception):
pass
class LineupsMissingException(GameException):
pass
class CardLegalityException(GameException):
pass
class GameNotFoundException(GameException):
pass
class TeamNotFoundException(GameException):
pass
class PlayNotFoundException(GameException):
pass
class PlayInitException(GameException):
pass