From f9b8ecf600ce01fd0c4262342a40892f4ca0af0f Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 5 Sep 2024 17:00:36 +0200 Subject: [PATCH] feat: return error from internet.open --- mqtt.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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