Skip to content

Jr bug fixes - #233

Open
joserb10 wants to merge 2 commits into
Base360-AI:mainfrom
joserb10:JR-bug-fixes
Open

joserb10 wants to merge 2 commits into
Base360-AI:mainfrom
joserb10:JR-bug-fixes

Conversation

@joserb10

Copy link
Copy Markdown

No description provided.

Comment on lines +16 to +19
try:
revenue_data = await get_revenue_summary(property_id, tenant_id)
except Exception:
raise HTTPException(status_code=503, detail="Revenue data is temporarily unavailable")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Catching all exceptions in get_dashboard_summary and converting them to HTTPException(503) swallows errors without logging tracebacks for non-database failures like Redis outages.
Severity: MEDIUM

Suggested Fix

Add a logger to backend/app/api/v1/dashboard.py and log the exception with logger.exception(...) within the except Exception block before raising the HTTPException.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: backend/app/api/v1/dashboard.py#L16-L19

Potential issue: In `get_dashboard_summary`, a bare `except Exception` catches all
exceptions arising from `get_revenue_summary` and raises an `HTTPException(503)` without
logging the exception details or traceback. Any failures outside the database path (such
as Redis connection outages, JSON serialization errors, or internal programming errors)
are swallowed silently without logs, preventing operators from diagnosing the root cause
of service unavailability.

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants