From 3a4786d2bebeee5a93eea7f6ae1ffdd06e81476b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 11 May 2025 20:01:44 +0200 Subject: [PATCH] httplib may throw on invalid protocol. --- profiler/src/profiler/TracyLlm.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index b688a3fb..caff28da 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -15,8 +15,16 @@ TracyLlm::TracyLlm() { if( !s_config.llm ) return; - m_ollama = std::make_unique( s_config.llmAddress ); - if( !m_ollama->is_running() ) + try + { + m_ollama = std::make_unique( s_config.llmAddress ); + if( !m_ollama->is_running() ) + { + m_ollama.reset(); + return; + } + } + catch( const std::exception& e ) { m_ollama.reset(); return;