📝 "Refactor: Update log rotation correction in logging update to app.log files
This commit is contained in:
12
app.py
12
app.py
@@ -382,6 +382,18 @@ def admin_required(f):
|
||||
return f(*args, **kwargs)
|
||||
return decorated_function
|
||||
|
||||
# Hilfsfunktion zur Fehlerbehandlung in API-Endpunkten
|
||||
def handle_api_exception(func):
|
||||
"""Decorator für API-Endpunkte zur einheitlichen Fehlerbehandlung"""
|
||||
@wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
try:
|
||||
return func(*args, **kwargs)
|
||||
except Exception as e:
|
||||
# Log und API-Fehler zurückgeben
|
||||
return ErrorHandler.handle_exception(e, is_api_request=True)
|
||||
return wrapper
|
||||
|
||||
@login_manager.user_loader
|
||||
def load_user(id):
|
||||
# Verwende session.get() anstelle von query.get() für SQLAlchemy 2.0 Kompatibilität
|
||||
|
||||
Reference in New Issue
Block a user