init: Log the error message that caused loading of a connection module to fail

Sat, 05 Sep 2015 15:13:52 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 05 Sep 2015 15:13:52 +0100
changeset 369
074c547fe05a
parent 368
154c2f04d73b
child 370
75e7917761c0

init: Log the error message that caused loading of a connection module to fail

init.lua file | annotate | diff | comparison | revisions
--- a/init.lua	Sun Nov 16 19:33:18 2014 +0100
+++ b/init.lua	Sat Sep 05 15:13:52 2015 +0100
@@ -23,9 +23,9 @@
 
 function verse.init(...)
 	for i=1,select("#", ...) do
-		local ok = pcall(require, "verse."..select(i,...));
+		local ok, err = pcall(require, "verse."..select(i,...));
 		if not ok then
-			error("Verse connection module not found: verse."..select(i,...));
+			error("Verse connection module not found: verse."..select(i,...).."\n"..err);
 		end
 	end
 	return verse;

mercurial