forked from luca/mineqtt
fix: disambiguate error messages
This commit is contained in:
parent
a6e2164fa9
commit
49194e94f0
4
mqtt.lua
4
mqtt.lua
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue