Coverage for .venv/lib/python3.13/site-packages/litellm/proxy/guardrails/exception_utils.py: 71%

7 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-10 12:01 +0000

1from collections.abc import Collection 

2 

3 

4def is_fastapi_http_exception(e: Exception, block_status_codes: Collection[int]) -> bool: 

5 try: 

6 from fastapi.exceptions import HTTPException 

7 except ImportError: 

8 return False 

9 return isinstance(e, HTTPException) and e.status_code in block_status_codes