mirror of
https://github.com/PaiGramTeam/StarRailDamageCal.git
synced 2024-11-30 02:44:15 +00:00
59 lines
1.2 KiB
Python
59 lines
1.2 KiB
Python
from typing import Union
|
|
|
|
|
|
class UidNotfoundError(Exception):
|
|
def __init__(self, uid: str):
|
|
self.uid = uid
|
|
|
|
def __str__(self):
|
|
return self.uid
|
|
|
|
|
|
class InvalidUidError(Exception):
|
|
def __init__(self, uid: str):
|
|
self.uid = uid
|
|
|
|
def __str__(self):
|
|
return self.uid
|
|
|
|
|
|
class CharNameError(Exception):
|
|
def __init__(self, char_name: str):
|
|
self.char_name = char_name
|
|
|
|
def __str__(self):
|
|
return self.char_name
|
|
|
|
|
|
class MihomoModelError(Exception):
|
|
def __init__(self, exce: Union[Exception, str]):
|
|
self.exce = exce.args[0] if isinstance(exce, Exception) else exce
|
|
|
|
def __str__(self):
|
|
return self.exce
|
|
|
|
|
|
class MihomoQueueTimeoutError(Exception):
|
|
def __str__(self):
|
|
return "Mihomo queue timeout, please try again later."
|
|
|
|
|
|
class MihomoRequestError(Exception):
|
|
def __init__(self, exce: Union[Exception, str]):
|
|
self.exce = exce.args[0] if isinstance(exce, Exception) else exce
|
|
|
|
def __str__(self):
|
|
return self.exce
|
|
|
|
|
|
class NotInCharacterShowcaseError(Exception):
|
|
pass
|
|
|
|
|
|
class CharacterShowcaseNotOpenError(Exception):
|
|
def __init__(self, uid: str):
|
|
self.uid = uid
|
|
|
|
def __str__(self):
|
|
return self.uid
|