# HG changeset patch # User Matthew Wild # Date 1332428901 0 # Node ID 2d85ac26799c5defd7d9688370715e093dde5400 # Parent 510f4ba7080f1075daf3775d9cffa0d0149842c4 util.debug: Add catch for an "error in error handling" diff -r 510f4ba7080f -r 2d85ac26799c util/debug.lua --- 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