mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix(proxy): appease type-discipline gate for key duration error envelope
This commit is contained in:
parent
d1d450b83e
commit
188e3a7cbc
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue