Better MQTT errors

This commit is contained in:
Sebastiaan de Schaetzen 2024-07-14 20:00:04 +02:00
parent a24e11ef18
commit 35626e13db
2 changed files with 5 additions and 0 deletions

View File

@ -77,6 +77,10 @@ function love.update(...)
end
end
function love.mqtt.onError(message)
print("MQTT error")
end
function love.mqtt.connect(connack)
if connack.rc ~= 0 then
print("Connection to broker failed:", connack:reason_string())

View File

@ -58,6 +58,7 @@ local function main()
message = onMessage,
error = function(message)
print("MQTT error: " .. message)
call("onError", message)
end
}