mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 11:45:43 +08:00
improve exceptions in case of corrupt packages close pipes after exception occoured to avoid lingering connections should fix #788
This commit is contained in:
@@ -134,7 +134,7 @@ namespace MQTTnet.Formatter
|
||||
{
|
||||
if (_length < _offset + length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(_buffer), $"Expected at least {_offset + length} bytes but there are only {_length} bytes");
|
||||
throw new MqttProtocolViolationException($"Expected at least {_offset + length} bytes but there are only {_length} bytes");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user