[rewrite] Updated models a bit, preparing to make first functional routes
This commit is contained in:
1 parent
414b84a2d4
commit
f0c378b20f
21 files changed
+203
-90
No files matched your search
@@ -0,0 +1,13 @@
|
||||
from functools import wraps
|
||||
from sqlalchemy.exc import DatabaseError as SqlAlchemyDatabaseError
|
||||
from app.database.exceptions import DatabaseError
|
||||
|
||||
|
||||
def handle_database_errors(func):
|
||||
@wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
try:
|
||||
return func(*args, **kwargs)
|
||||
except SqlAlchemyDatabaseError as e:
|
||||
raise DatabaseError(str(e), -1) from e
|
||||
return wrapper
|
||||
Whitespace-only changes.
Reference in new issue
Block a user