Files
romm/backend/utils/exceptions.py
2023-05-17 10:19:28 +02:00

34 lines
1.1 KiB
Python

class PlatformsNotFoundException(Exception):
def __init__(self):
self.message = f"Platforms not found. Check RomM folder structure here: https://github.com/zurdi15/romm#-folder-structure"
super().__init__(self.message)
def __repr__(self) -> str:
return self.message
class RomsNotFoundException(Exception):
def __init__(self, platform: str):
self.message = f"Roms not found for platform {platform}. Check RomM folder structure here: https://github.com/zurdi15/romm#-folder-structure"
super().__init__(self.message)
def __repr__(self) -> str:
return self.message
class RomNotFoundError(Exception):
def __init__(self, rom: str, platform: str):
self.message = f"Rom {rom} not found for platform {platform}"
super().__init__(self.message)
def __repr__(self) -> str:
return self.message
class RomAlreadyExistsException(Exception):
def __init__(self, rom_name: str):
self.message = f"Can't rename: {rom_name} already exists"
super().__init__(self.message)
def __repr__(self) -> str:
return self.message