Changeset

8546:d66916dc318a

net.connect: Track last connection error
author Matthew Wild <mwild1@gmail.com>
date Mon, 26 Feb 2018 15:20:35 +0000
parents 8545:248bab2bd0c9
children 8547:5e9c87376891
files net/connect.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/connect.lua	Sun Feb 25 11:20:56 2018 +0100
+++ b/net/connect.lua	Mon Feb 26 15:20:35 2018 +0000
@@ -56,7 +56,8 @@
 		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