Fix logging in example when error is nil

This commit is contained in:
Björn Ritzl 2021-01-14 09:49:08 +01:00
parent 73b236b249
commit f988413a74

View File

@ -73,7 +73,7 @@ local function websocket_callback(self, conn, data)
update_gui(self) update_gui(self)
log("Connected: " .. tostring(conn)) log("Connected: " .. tostring(conn))
elseif data.event == websocket.EVENT_ERROR then elseif data.event == websocket.EVENT_ERROR then
log("Error: '" .. data.error .. "'") log("Error: '" .. tostring(data.error) .. "'")
elseif data.event == websocket.EVENT_MESSAGE then elseif data.event == websocket.EVENT_MESSAGE then
log("Receiving: '" .. tostring(data.message) .. "'") log("Receiving: '" .. tostring(data.message) .. "'")
end end