From a59515a74bf40b3e794c8f2b08c04eb7a99f82dc Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 24 Dec 2025 06:35:04 -0700 Subject: [PATCH] Catch remote protocol error from ollama --- frigate/genai/ollama.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frigate/genai/ollama.py b/frigate/genai/ollama.py index 9f9c8a750..a54141e4d 100644 --- a/frigate/genai/ollama.py +++ b/frigate/genai/ollama.py @@ -3,7 +3,7 @@ import logging from typing import Any, Optional -from httpx import TimeoutException +from httpx import RemoteProtocolError, TimeoutException from ollama import Client as ApiClient from ollama import ResponseError @@ -68,7 +68,12 @@ class OllamaClient(GenAIClient): f"Ollama tokens used: eval_count={result.get('eval_count')}, prompt_eval_count={result.get('prompt_eval_count')}" ) return result["response"].strip() - except (TimeoutException, ResponseError, ConnectionError) as e: + except ( + TimeoutException, + ResponseError, + RemoteProtocolError, + ConnectionError, + ) as e: logger.warning("Ollama returned an error: %s", str(e)) return None