[<<][lua][>>][..]
Wed Apr 8 17:41:38 EDT 2020

catching coroutine errors

This works up to the first suspend point:

-- Start a task that can perform synchronous reads.
function uvco.start_task(body, error_handler)
   uv.timer():start(
      0, 0,
      function()
         -- logd({spawning = body})
         local co = coroutine.create(
            function()
               -- Wrap this call.  By default, coroutine errors just
               -- get ignored.  Now unhandled errors exit the
               -- application and print a stack trace.
               coxpcall.xpcall(
                  body,
                  uvco.error_handler)
            end)
         resume(co)
      end)
end

But once coroutine has yielded/resumed, it no longer works.

What madness is his?

I'm going to take it out of the application.



http://lua-users.org/lists/lua-l/2005-06/msg00175.html



[Reply][About]
[<<][lua][>>][..]