diff --git a/app/main.py b/app/main.py index be07a48..592b348 100644 --- a/app/main.py +++ b/app/main.py @@ -85,7 +85,11 @@ async def portal_post(path: str, payload: dict) -> dict: detail = r.json().get("detail", r.text) except Exception: detail = r.text - raise HTTPException(502, f"Portal error {r.status_code}: {detail}") + # Pass the portal's OWN status through. Collapsing every upstream failure + # into 502 turned a plain rate limit ("Too many requests. Slow down.") + # into "Could not send guest access (502)" — a gateway error the operator + # cannot act on, for a condition that clears in a minute and says so. + raise HTTPException(r.status_code, f"Portal error {r.status_code}: {detail}") return r.json()