From 27adde1c9ca6f9efecc04df8175a9f4f9022a5a3 Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Mon, 1 Apr 2019 10:00:31 -0700 Subject: [PATCH] Simplify exception when an encoder is not found --- src/ImageSharp/ImageExtensions.cs | 6 +++--- src/ImageSharp/Memory/RowInterval.cs | 11 ++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/ImageSharp/ImageExtensions.cs b/src/ImageSharp/ImageExtensions.cs index cbf93275c8..e4a08d6bbb 100644 --- a/src/ImageSharp/ImageExtensions.cs +++ b/src/ImageSharp/ImageExtensions.cs @@ -33,7 +33,7 @@ namespace SixLabors.ImageSharp if (format is null) { var sb = new StringBuilder(); - sb.AppendLine($"Can't find a format that is associated with the file extension '{ext}'. Registered formats with there extensions include:"); + sb.AppendLine($"No encoder was found for extension '{ext}'. Registered encoders include:"); foreach (IImageFormat fmt in source.GetConfiguration().ImageFormats) { sb.AppendLine($" - {fmt.Name} : {string.Join(", ", fmt.FileExtensions)}"); @@ -47,7 +47,7 @@ namespace SixLabors.ImageSharp if (encoder is null) { var sb = new StringBuilder(); - sb.AppendLine($"Can't find encoder for file extension '{ext}' using image format '{format.Name}'. Registered encoders include:"); + sb.AppendLine($"No encoder was found for extension '{ext}' using image format '{format.Name}'. Registered encoders include:"); foreach (KeyValuePair enc in source.GetConfiguration().ImageFormatsManager.ImageEncoders) { sb.AppendLine($" - {enc.Key} : {enc.Value.GetType().Name}"); @@ -94,7 +94,7 @@ namespace SixLabors.ImageSharp if (encoder is null) { var sb = new StringBuilder(); - sb.AppendLine("Can't find encoder for provided mime type. Available encoded:"); + sb.AppendLine("No encoder was found for the provided mime type. Registered encoders include:"); foreach (KeyValuePair val in source.GetConfiguration().ImageFormatsManager.ImageEncoders) { diff --git a/src/ImageSharp/Memory/RowInterval.cs b/src/ImageSharp/Memory/RowInterval.cs index 501ed5e69c..835e880e94 100644 --- a/src/ImageSharp/Memory/RowInterval.cs +++ b/src/ImageSharp/Memory/RowInterval.cs @@ -22,24 +22,21 @@ namespace SixLabors.ImageSharp.Memory } /// - /// Gets the INCLUSIVE minimum + /// Gets the INCLUSIVE minimum. /// public int Min { get; } /// - /// Gets the EXCLUSIVE maximum + /// Gets the EXCLUSIVE maximum. /// public int Max { get; } /// - /// Gets the difference ( - ) + /// Gets the difference ( - ). /// public int Height => this.Max - this.Min; /// - public override string ToString() - { - return $"RowInterval [{this.Min}->{this.Max}["; - } + public override string ToString() => $"RowInterval [{this.Min}->{this.Max}]"; } } \ No newline at end of file