fix(proxy): appease type-discipline gate for key duration error envelope

This commit is contained in:
soroush5 2026-09-11 11:53:11 +03:30
parent d1d450b83e
commit 188e3a7cbc

View file

@ -38,9 +38,10 @@ def validate_key_duration(duration: str | None) -> None:
try:
duration_in_seconds(duration)
except (ValueError, OverflowError):
message = f"Invalid duration '{duration}'. Use a format like '1h', '24h', '7d', or '30d'."
raise HTTPException(
status_code=400,
detail={"error": f"Invalid duration '{duration}'. Use a format like '1h', '24h', '7d', or '30d'."},
detail={"error": message}, # mutable-ok: single-shot error envelope
)