Spaces:
Building
Building
Update admin_routes.py
Browse files- admin_routes.py +4 -1
admin_routes.py
CHANGED
@@ -34,13 +34,16 @@ from config_models import VersionConfig, IntentConfig, LLMConfiguration
|
|
34 |
security = HTTPBearer()
|
35 |
router = APIRouter(tags=["admin"])
|
36 |
|
37 |
-
# =====================
|
38 |
def handle_exceptions(func):
|
39 |
"""Decorator to handle exceptions consistently"""
|
40 |
@wraps(func)
|
41 |
async def wrapper(*args, **kwargs):
|
42 |
try:
|
43 |
return await func(*args, **kwargs)
|
|
|
|
|
|
|
44 |
except FlareException:
|
45 |
# Let global handlers deal with our custom exceptions
|
46 |
raise
|
|
|
34 |
security = HTTPBearer()
|
35 |
router = APIRouter(tags=["admin"])
|
36 |
|
37 |
+
# ===================== Decorators =====================
|
38 |
def handle_exceptions(func):
|
39 |
"""Decorator to handle exceptions consistently"""
|
40 |
@wraps(func)
|
41 |
async def wrapper(*args, **kwargs):
|
42 |
try:
|
43 |
return await func(*args, **kwargs)
|
44 |
+
except HTTPException:
|
45 |
+
# HTTPException'ları olduğu gibi geçir
|
46 |
+
raise
|
47 |
except FlareException:
|
48 |
# Let global handlers deal with our custom exceptions
|
49 |
raise
|