Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CODE RUB: InvalidConfigurationAIModelException Class Update v2.10.1 #515

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions
{
public class InvalidConfigurationAIModelException : Xeption
{
public InvalidConfigurationAIModelException(Exception innerException)
: base(
message: "Invalid AI Model configuration error occurred, contact support.",
innerException: innerException)
{ }

public InvalidConfigurationAIModelException(string message, Exception innerException)
: base(message, innerException) { }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ private async ValueTask<AIModel> TryCatch(ReturningAIModelFunction returningAIMo
catch (HttpResponseUrlNotFoundException httpResponseUrlNotFoundException)
{
var invalidConfigurationAIModelException =
new InvalidConfigurationAIModelException(httpResponseUrlNotFoundException);
CreateInvalidConfigurationAIModelException(
httpResponseUrlNotFoundException);

throw new AIModelDependencyException(invalidConfigurationAIModelException);
}
Expand Down Expand Up @@ -94,7 +95,8 @@ private async ValueTask<IEnumerable<AIModel>> TryCatch(ReturningAIModelsFunction
catch (HttpResponseUrlNotFoundException httpResponseUrlNotFoundException)
{
var invalidConfigurationAIModelException =
new InvalidConfigurationAIModelException(httpResponseUrlNotFoundException);
CreateInvalidConfigurationAIModelException(
httpResponseUrlNotFoundException);

throw new AIModelDependencyException(invalidConfigurationAIModelException);
}
Expand Down Expand Up @@ -135,5 +137,12 @@ private async ValueTask<IEnumerable<AIModel>> TryCatch(ReturningAIModelsFunction
failedAIModelServiceException);
}
}

private static InvalidConfigurationAIModelException CreateInvalidConfigurationAIModelException(Exception innerException)
{
return new InvalidConfigurationAIModelException(
message: "Invalid AI Model configuration error occurred, contact support.",
innerException);
}
}
}