Diff

util/promise.lua @ 9559:7c65e3f38e6e

util.promise: Switch from pcall to xpcall to get tracebacks on exceptions
author Matthew Wild <mwild1@gmail.com>
date Fri, 26 Oct 2018 16:09:25 +0100
parent 9558:5fa73fbb047f
child 9562:acf74ad0b795
line wrap: on
line diff
--- a/util/promise.lua	Fri Oct 26 09:23:31 2018 +0100
+++ b/util/promise.lua	Fri Oct 26 16:09:25 2018 +0100
@@ -15,7 +15,7 @@
 		return default;
 	end
 	return function (param)
-		local ok, ret = pcall(f, param);
+		local ok, ret = xpcall(f, debug.traceback, param);
 		if ok then
 			resolve(ret);
 		else