Initial release: async repository layer over SQLModel
This commit is contained in:
17
metaorm/exceptions.py
Normal file
17
metaorm/exceptions.py
Normal file
@@ -0,0 +1,17 @@
|
||||
class DatabaseException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class NotFoundError(DatabaseException):
|
||||
def __init__(self, detail: str = "Not found"):
|
||||
super().__init__(detail)
|
||||
|
||||
|
||||
class HaveNoSessionError(DatabaseException):
|
||||
def __init__(self):
|
||||
super().__init__("Have no actual session")
|
||||
|
||||
|
||||
class AlreadyExistsError(DatabaseException):
|
||||
def __init__(self, detail: str = "Record already exists"):
|
||||
super().__init__(detail)
|
||||
Reference in New Issue
Block a user