Skip to content

Commit

Permalink
Fix code scanning alert no. 4: Information exposure through an exception
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
creatorrr and github-advanced-security[bot] authored Dec 19, 2024
1 parent da9dd5b commit f6a49ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions agents-api/agents_api/routers/healthz/check_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from ...autogen.openapi_model import Agent, ListResponse
from ...models.agent.list_agents import list_agents as list_agents_query
from .router import router

import logging

@router.get("/healthz", tags=["healthz"])
async def check_health() -> dict:
Expand All @@ -13,6 +13,7 @@ async def check_health() -> dict:
developer_id=UUID("00000000-0000-0000-0000-000000000000"),
)
except Exception as e:
return {"status": "error", "message": str(e)}
logging.error("An error occurred while checking health: %s", str(e))
return {"status": "error", "message": "An internal error has occurred."}

return {"status": "ok"}

0 comments on commit f6a49ec

Please sign in to comment.