From 49194e94f0d86eb3b2d2b1e97c7214422a2cae3b Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 5 Sep 2024 22:31:26 +0200 Subject: [PATCH] fix: disambiguate error messages --- mqtt.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mqtt.lua b/mqtt.lua index c8802eb..038a677 100644 --- a/mqtt.lua +++ b/mqtt.lua @@ -119,7 +119,7 @@ function MqttClient:handle () if flags ~= 0 then self:disconnect(0x81) - return "malformed packet" + return "invalid flags" end if reason > 127 then @@ -130,7 +130,7 @@ function MqttClient:handle () return "connection closed by server" elseif reason ~= 0 then self:disconnect(0x81) - return "malformed packet" + return "unrecognized reason" end self.is_connecting = false