util/debug.lua
changeset 4520 2d85ac26799c
parent 4519 510f4ba7080f
child 4521 4c7495f7f543
--- a/util/debug.lua	Thu Mar 22 15:07:27 2012 +0000
+++ b/util/debug.lua	Thu Mar 22 15:08:21 2012 +0000
@@ -88,7 +88,15 @@
 	return levels;
 end
 
-function debug.traceback(thread, message, level)
+function debug.traceback(...)
+	local ok, ret = pcall(debug._traceback, ...);
+	if not ok then
+		return "Error in error handling: "..ret;
+	end
+	return ret;
+end
+
+function debug._traceback(thread, message, level)
 	if type(thread) ~= "thread" then
 		thread, message, level = coroutine.running(), thread, message;
 	end