fix: disambiguate error messages

This commit is contained in:
Luca 2024-09-05 22:31:26 +02:00
parent a6e2164fa9
commit 49194e94f0
1 changed files with 2 additions and 2 deletions

View File

@ -119,7 +119,7 @@ function MqttClient:handle ()
if flags ~= 0 then if flags ~= 0 then
self:disconnect(0x81) self:disconnect(0x81)
return "malformed packet" return "invalid flags"
end end
if reason > 127 then if reason > 127 then
@ -130,7 +130,7 @@ function MqttClient:handle ()
return "connection closed by server" return "connection closed by server"
elseif reason ~= 0 then elseif reason ~= 0 then
self:disconnect(0x81) self:disconnect(0x81)
return "malformed packet" return "unrecognized reason"
end end
self.is_connecting = false self.is_connecting = false