Improved NetBIOS related exception messages and documentation

This commit is contained in:
Tal Aloni 2017-02-20 21:20:51 +02:00
parent 36ca529f79
commit 3f78fb81ff
2 changed files with 3 additions and 2 deletions

View file

@ -55,6 +55,7 @@ namespace SMBLibrary.NetBios
/// HasCompletePacket must be called and return true before calling DequeuePacket
/// </summary>
/// <exception cref="System.IO.InvalidDataException"></exception>
/// <exception cref="SMBLibrary.InvalidRequestException"></exception>
public SessionPacket DequeuePacket()
{
SessionPacket packet;
@ -64,7 +65,7 @@ namespace SMBLibrary.NetBios
}
catch (IndexOutOfRangeException ex)
{
throw new System.IO.InvalidDataException("Invalid Packet", ex);
throw new System.IO.InvalidDataException("Invalid NetBIOS session packet", ex);
}
RemovePacketBytes();
return packet;

View file

@ -73,7 +73,7 @@ namespace SMBLibrary.NetBios
case SessionPacketTypeName.SessionKeepAlive:
return new SessionKeepAlivePacket(buffer, offset);
default:
throw new InvalidRequestException("Invalid NetBIOS Session Packet");
throw new InvalidRequestException("Invalid NetBIOS session packet type");
}
}
}