diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 32d2e74..efe0e87 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -29,7 +29,7 @@ - 0.5.0-beta + 0.6.0-beta diff --git a/src/Menees.Remoting/Models/Message.cs b/src/Menees.Remoting/Models/Message.cs index 9c7a6cf..9abb382 100644 --- a/src/Menees.Remoting/Models/Message.cs +++ b/src/Menees.Remoting/Models/Message.cs @@ -105,7 +105,7 @@ private static byte[] RequireRead(Stream stream, int requiredCount, string forWh if (totalCount != requiredCount) { - throw new ArgumentException( + throw new EndOfStreamException( $"Unable to read {requiredCount} byte {forWhat} from stream. Only {totalCount} bytes were available."); } @@ -154,7 +154,7 @@ void ThrowIfCancellationRequested() if (totalCount != requiredCount) { ThrowIfCancellationRequested(); - throw new ArgumentException( + throw new EndOfStreamException( $"Unable to read {requiredCount} byte {forWhat} from stream. Only {totalCount} bytes were available."); }