Explorar o código

Improved NetBIOS related exception messages and documentation

Tal Aloni %!s(int64=8) %!d(string=hai) anos
pai
achega
3f78fb81ff

+ 2 - 1
SMBLibrary/NetBios/NBTConnectionReceiveBuffer.cs

@@ -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;

+ 1 - 1
SMBLibrary/NetBios/SessionPackets/SessionPacket.cs

@@ -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");
             }
         }
     }