httplib may throw on invalid protocol.

This commit is contained in:
Bartosz Taudul
2025-05-11 20:01:44 +02:00
parent 4c7338ec1e
commit 3a4786d2be

View File

@@ -15,8 +15,16 @@ TracyLlm::TracyLlm()
{
if( !s_config.llm ) return;
m_ollama = std::make_unique<Ollama>( s_config.llmAddress );
if( !m_ollama->is_running() )
try
{
m_ollama = std::make_unique<Ollama>( s_config.llmAddress );
if( !m_ollama->is_running() )
{
m_ollama.reset();
return;
}
}
catch( const std::exception& e )
{
m_ollama.reset();
return;