Improved type-hinting and overall sanity checks implemented.
This commit is contained in:
1
errors/__init__.py
Normal file
1
errors/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .user import UserNotFoundError
|
10
errors/user.py
Normal file
10
errors/user.py
Normal 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"
|
||||
)
|
Reference in New Issue
Block a user