2 Commits

Author SHA1 Message Date
Matt Nadareski
96c6bba93e Bump version 2024-05-13 16:19:17 -04:00
Matt Nadareski
b0d81f225b Fix thrown exception statements 2024-05-12 10:56:15 -04:00
3 changed files with 5 additions and 5 deletions

View File

@@ -862,7 +862,7 @@ namespace SabreTools.IO.Extensions
{
// If we have an invalid length
if (length < 0)
throw new ArgumentOutOfRangeException($"{nameof(length)} must be 0 or a positive value");
throw new ArgumentOutOfRangeException($"{nameof(length)} must be 0 or a positive value, {length} requested");
// Handle the 0-byte case
if (length == 0)
@@ -870,7 +870,7 @@ namespace SabreTools.IO.Extensions
// If there are not enough bytes
if (offset + length > content.Length)
throw new System.IO.EndOfStreamException($"Requested to read {nameof(length)} bytes from {nameof(content)}, {content.Length - offset} returned");
throw new System.IO.EndOfStreamException($"Requested to read {length} bytes from {nameof(content)}, {content.Length - offset} returned");
// Handle the general case, forcing a read of the correct length
byte[] buffer = new byte[length];

View File

@@ -846,7 +846,7 @@ namespace SabreTools.IO.Extensions
{
// If we have an invalid length
if (length < 0)
throw new ArgumentOutOfRangeException($"{nameof(length)} must be 0 or a positive value");
throw new ArgumentOutOfRangeException($"{nameof(length)} must be 0 or a positive value, {length} requested");
// Handle the 0-byte case
if (length == 0)
@@ -856,7 +856,7 @@ namespace SabreTools.IO.Extensions
byte[] buffer = new byte[length];
int read = stream.Read(buffer, 0, length);
if (read < length)
throw new EndOfStreamException($"Requested to read {nameof(length)} bytes from {nameof(stream)}, {read} returned");
throw new EndOfStreamException($"Requested to read {length} bytes from {nameof(stream)}, {read} returned");
return buffer;
}

View File

@@ -7,7 +7,7 @@
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.4.10</Version>
<Version>1.4.11</Version>
<WarningsNotAsErrors>CS0618</WarningsNotAsErrors>
<!-- Package Properties -->