Skip to content

Commit

Permalink
Merge pull request #549 from Lezune/users/Lezune/Clients-ImageGenerat…
Browse files Browse the repository at this point in the history
…ions-Update

CODE RUB: Clients ImageGenerations Exceptions Update v2.10.1
  • Loading branch information
glhays authored Jun 12, 2024
2 parents fcb3604 + 0885ec9 commit 18b23c6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,48 @@ public async ValueTask<ImageGeneration> GenerateImageAsync(ImageGeneration image
}
catch (ImageGenerationValidationException imageGenerationValidationException)
{
throw new ImageGenerationClientValidationException(
throw CreateImageGenerationClientValidationException(
imageGenerationValidationException.InnerException as Xeption);
}
catch (ImageGenerationDependencyValidationException imageGenerationDependencyValidationException)
{
throw new ImageGenerationClientValidationException(
throw CreateImageGenerationClientValidationException(
imageGenerationDependencyValidationException.InnerException as Xeption);
}
catch (ImageGenerationDependencyException imageGenerationDependencyException)
{
throw new ImageGenerationClientDependencyException(
throw CreateImageGenerationClientDependencyException(
imageGenerationDependencyException.InnerException as Xeption);
}
catch (ImageGenerationServiceException imageGenerationServiceException)
{
throw new ImageGenerationClientServiceException(
throw CreateImageGenerationClientServiceException(
imageGenerationServiceException.InnerException as Xeption);
}
}

private static ImageGenerationClientValidationException CreateImageGenerationClientValidationException(
Xeption innerException)
{
return new ImageGenerationClientValidationException(
message: "Image generation client validation error occurred, fix errors and try again.",
innerException);
}

private static ImageGenerationClientDependencyException CreateImageGenerationClientDependencyException(
Xeption innerException)
{
return new ImageGenerationClientDependencyException(
message: "Image generation client dependency error occurred, contact support.",
innerException);
}

private static ImageGenerationClientServiceException CreateImageGenerationClientServiceException(
Xeption innerException)
{
return new ImageGenerationClientServiceException(
message: "Image generation client service error occurred, contact support.",
innerException);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ namespace Standard.AI.OpenAI.Models.Clients.ImageGenerations.Exceptions
/// </summary>
public class ImageGenerationClientDependencyException : Xeption
{
public ImageGenerationClientDependencyException(Xeption innerException)
: base(
message: "Image generation client dependency error occurred, contact support.",
innerException: innerException)
{ }

public ImageGenerationClientDependencyException(string message, Xeption innerException)
: base(message, innerException)
{ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ namespace Standard.AI.OpenAI.Models.Clients.ImageGenerations.Exceptions
/// </summary>
public class ImageGenerationClientServiceException : Xeption
{
public ImageGenerationClientServiceException(Xeption innerException)
: base(
message: "Image generation client service error occurred, contact support.",
innerException: innerException)
{ }

public ImageGenerationClientServiceException(string message, Xeption innerException)
: base(message, innerException)
{ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ namespace Standard.AI.OpenAI.Models.Clients.ImageGenerations.Exceptions
/// </summary>
public class ImageGenerationClientValidationException : Xeption
{
public ImageGenerationClientValidationException(Xeption innerException)
: base(
message: "Image generation client validation error occurred, fix errors and try again.",
innerException: innerException)
{ }

public ImageGenerationClientValidationException(string message, Xeption innerException)
: base(message, innerException)
{ }
Expand Down

0 comments on commit 18b23c6

Please sign in to comment.