--- 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