From 1b2050bb8698eba462926a802e2c46ea08f07abd Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sat, 13 Dec 2025 16:15:59 +0100 Subject: [PATCH] Improved logging in the AiProvider --- src/Server/AIProvider.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Server/AIProvider.cs b/src/Server/AIProvider.cs index 8b4d340..323db4f 100644 --- a/src/Server/AIProvider.cs +++ b/src/Server/AIProvider.cs @@ -105,14 +105,15 @@ public class AIProvider JToken? responseContentTokens = responseContentJson.SelectToken(embeddingsJsonPath); if (responseContentTokens is null) { - throw new Exception($"Unable to select tokens using JSONPath {embeddingsJsonPath}."); // TODO add proper exception + _logger.LogError("Unable to select tokens using JSONPath {embeddingsJsonPath} for string: {responseContent}.", [embeddingsJsonPath, responseContent]); + throw new Exception($"Unable to select tokens using JSONPath {embeddingsJsonPath} for string: {responseContent}."); // TODO add proper exception } return [.. responseContentTokens.Values()]; } catch (Exception ex) { _logger.LogError("Unable to parse the response to valid embeddings. {ex.Message}", [ex.Message]); - throw new Exception($"Unable to parse the response to valid embeddings. {ex.Message}"); // TODO add proper exception + throw; } } }