Uklid v alembic migracich, error logging, upravy kvuli autorizaci

This commit is contained in:
Michal Kváček
2023-08-14 15:01:13 +02:00
parent bc260a2a8b
commit 97295c17c0
38 changed files with 203 additions and 957 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
from functools import wraps
from graphql import GraphQLError
from sqlalchemy.exc import NoResultFound
def error_logging(func):
@@ -7,7 +8,7 @@ def error_logging(func):
async def decorator(*args, **kwargs):
try:
return await func(*args, **kwargs)
except Exception as e:
raise GraphQLError(f"Not found")
except NoResultFound as e:
raise GraphQLError(f"Not found", original_error=e)
return decorator