portal errors keep their own status instead of becoming 502
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
portal_post collapsed every non-2xx upstream response into HTTPException(502), so
a plain rate limit ("Too many requests. Slow down.") reached the operator as
"Could not send guest access (502)": a gateway failure, for a condition that
clears in a minute and whose message said exactly that.
The status now passes through, so a 429 arrives as a 429 with the portal's own
words.
This commit is contained in:
1 parent
a90f8fdb36
commit
b1cf76c02d
1 file changed
+5
-1
+5
-1
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user