Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit bea209a

Browse files
committed
chore: revert unecessary changes to server.py
1 parent 5424fdc commit bea209a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/codegate/server.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import traceback
2-
from typing import AsyncGenerator
32

43
import structlog
5-
from fastapi import APIRouter, Depends, FastAPI, Request
4+
from fastapi import APIRouter, FastAPI, Request
65
from fastapi.middleware.cors import CORSMiddleware
76
from fastapi.responses import JSONResponse
87
from starlette.middleware.errors import ServerErrorMiddleware
@@ -19,6 +18,7 @@
1918

2019
logger = structlog.get_logger("codegate")
2120

21+
2222
async def custom_error_handler(request, exc: Exception):
2323
"""This is a Middleware to handle exceptions and log them."""
2424
# Capture the stack trace
@@ -27,6 +27,7 @@ async def custom_error_handler(request, exc: Exception):
2727
logger.error(traceback.print_list(extracted_traceback[-3:]))
2828
return JSONResponse({"error": str(exc)}, status_code=500)
2929

30+
3031
def init_app(pipeline_factory: PipelineFactory) -> FastAPI:
3132
"""Create the FastAPI application."""
3233
app = FastAPI(
@@ -96,4 +97,4 @@ async def health_check():
9697
app.include_router(system_router)
9798
app.include_router(dashboard_router)
9899

99-
return app
100+
return app

0 commit comments

Comments
 (0)