fix(ollama): make session usage limit check case-insensitive

Apply code review suggestion: use error_str.lower() for both checks
for consistent case handling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
tombii 2026-03-03 15:15:08 +01:00
parent 5b8fef098d
commit e9d6137ef3

View file

@ -2040,7 +2040,7 @@ def exception_type( # type: ignore # noqa: PLR0915
llm_provider="ollama",
model=model,
)
elif "session usage limit" in error_str or "rate limit" in error_str.lower():
elif "session usage limit" in error_str.lower() or "rate limit" in error_str.lower():
exception_mapping_worked = True
raise RateLimitError(
message=f"OllamaException: {original_exception}",