Re: debug.traceback as an error handler for coroutines
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: debug.traceback as an error handler for coroutines
- From: Matt Campbell <mattc@...>
- Date: 2006年3月04日 10:42:11 -0600
Please disregard my previous question. On examining the C source for
debug.traceback (db_errorfb in ldblib.c), I found that debug.traceback
can take a thread as its first argument and provide a traceback of the
call stack for that thread, which isn't unwound on error according to
the manual's description of lua_resume. So this can be used with
coroutine.resume as follows:
local succeeded, result = coroutine.resume(c)
if not succeeded then
print(debug.traceback(c, result))
end
Problem solved.
--
Matt Campbell
Lead Programmer
Serotek Corporation
www.freedombox.info
"The Accessibility Anywhere People"