diff --git a/mqtt.lua b/mqtt.lua index 7d42624..671d030 100644 --- a/mqtt.lua +++ b/mqtt.lua @@ -29,9 +29,9 @@ end local MqttClient = {} function mqtt.open (address, port) - local conn = require("internet").open(address, port) + local conn, err = require("internet").open(address, port) if conn == nil then - return nil, "connection failed" + return nil, err end return MqttClient:new(conn), nil