Improved type-hinting and overall sanity checks implemented.

This commit is contained in:
kku
2024-12-16 20:34:37 +01:00
parent 5c763fc02e
commit c05cf64ae0
14 changed files with 193 additions and 165 deletions

1
errors/__init__.py Normal file
View File

@@ -0,0 +1 @@
from .user import UserNotFoundError

10
errors/user.py Normal file
View File

@@ -0,0 +1,10 @@
class UserNotFoundError(Exception):
"""HoloUser could not find user with such an ID in database"""
def __init__(self, user, user_id):
self.user = user
self.user_id = user_id
super().__init__(
f"User of type {type(self.user)} with id {self.user_id} was not found"
)