fix: dont log routes.json 404 (#3665)

This commit is contained in:
dni ⚡ 2025-12-16 13:10:02 +01:00 committed by GitHub
parent 7747d7b741
commit b6e111b21c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -138,6 +138,8 @@ def register_exception_handlers(app: FastAPI): # noqa: C901
@app.exception_handler(404) @app.exception_handler(404)
async def error_handler_404(request: Request, exc: HTTPException): async def error_handler_404(request: Request, exc: HTTPException):
if not request.url.path.endswith("routes.json"):
logger.error(f"404: {request.url.path} {exc.status_code}: {exc.detail}") logger.error(f"404: {request.url.path} {exc.status_code}: {exc.detail}")
if not _is_browser_request(request): if not _is_browser_request(request):