mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-10 17:25:51 +00:00
Improve exception message when attempting to read more bytes than available.
This commit is contained in:
@@ -220,7 +220,9 @@ namespace Renci.SshNet.Common
|
||||
var bytesRead = Read(data, 0, length);
|
||||
|
||||
if (bytesRead < length)
|
||||
throw new ArgumentOutOfRangeException("length");
|
||||
throw new ArgumentOutOfRangeException("length",
|
||||
string.Format(CultureInfo.InvariantCulture,
|
||||
"The requested length ({0}) is greater than the actual number of bytes read ({1}).", length, bytesRead));
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user