diff --git a/src/Server/AIProvider.cs b/src/Server/AIProvider.cs index 323db4f..0a244a2 100644 --- a/src/Server/AIProvider.cs +++ b/src/Server/AIProvider.cs @@ -106,7 +106,7 @@ public class AIProvider if (responseContentTokens is null) { _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 + throw new JSONPathSelectionException(embeddingsJsonPath, responseContent); } return [.. responseContentTokens.Values()]; } diff --git a/src/Server/Exceptions/SearchdomainExceptions.cs b/src/Server/Exceptions/GeneralExceptions.cs similarity index 59% rename from src/Server/Exceptions/SearchdomainExceptions.cs rename to src/Server/Exceptions/GeneralExceptions.cs index 7384532..e5a37b1 100644 --- a/src/Server/Exceptions/SearchdomainExceptions.cs +++ b/src/Server/Exceptions/GeneralExceptions.cs @@ -2,4 +2,6 @@ namespace Server.Exceptions; public class ProbMethodNotFoundException(string probMethod) : Exception($"Unknown probMethod name {probMethod}") { } -public class SimilarityMethodNotFoundException(string similarityMethod) : Exception($"Unknown similarityMethod name \"{similarityMethod}\"") { } \ No newline at end of file +public class SimilarityMethodNotFoundException(string similarityMethod) : Exception($"Unknown similarityMethod name \"{similarityMethod}\"") { } + +public class JSONPathSelectionException(string path, string testedContent) : Exception($"Unable to select tokens using JSONPath {path} for string: {testedContent}.") { } \ No newline at end of file