fix(backend): redact retryable MAX storage failures
CI / ruff · pytest (pull_request) Successful in 2m4s
CI / ruff · pytest (pull_request) Successful in 2m4s
Refs #82
This commit is contained in:
@@ -10,6 +10,7 @@ from fastapi import APIRouter, Depends, HTTPException, Request
|
||||
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from app.config import get_settings
|
||||
from app.core import clock
|
||||
@@ -106,5 +107,9 @@ async def webhook(request: Request) -> dict[str, bool]:
|
||||
raise HTTPException(422, "event must be an object")
|
||||
from app.channels.max_bot import handle_update
|
||||
|
||||
await handle_update(event)
|
||||
try:
|
||||
await handle_update(event)
|
||||
except SQLAlchemyError:
|
||||
# Let MAX retry; do not log DB exception parameters containing identity data.
|
||||
raise HTTPException(503, "notification storage unavailable") from None
|
||||
return {"success": True}
|
||||
|
||||
Reference in New Issue
Block a user