Better MQTT errors
This commit is contained in:
parent
a24e11ef18
commit
35626e13db
@ -77,6 +77,10 @@ function love.update(...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function love.mqtt.onError(message)
|
||||||
|
print("MQTT error")
|
||||||
|
end
|
||||||
|
|
||||||
function love.mqtt.connect(connack)
|
function love.mqtt.connect(connack)
|
||||||
if connack.rc ~= 0 then
|
if connack.rc ~= 0 then
|
||||||
print("Connection to broker failed:", connack:reason_string())
|
print("Connection to broker failed:", connack:reason_string())
|
||||||
|
@ -58,6 +58,7 @@ local function main()
|
|||||||
message = onMessage,
|
message = onMessage,
|
||||||
error = function(message)
|
error = function(message)
|
||||||
print("MQTT error: " .. message)
|
print("MQTT error: " .. message)
|
||||||
|
call("onError", message)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user