From c394f11359d7670f675f1ab525ae1fc2aec0570a Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 26 Feb 2018 15:20:35 +0000 Subject: net.connect: Track last connection error --- net/connect.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'net') diff --git a/net/connect.lua b/net/connect.lua index 675116e2..aa6e622b 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -56,7 +56,8 @@ function pending_connection_listeners.ondisconnect(conn, reason) log("warn", "Failed connection, but unexpected!"); return; end - p:log("debug", "Connection attempt failed"); + p.last_error = reason or "unknown reason"; + p:log("debug", "Connection attempt failed: %s", p.last_error); attempt_connection(p); end -- cgit v1.2.3