File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -400,12 +400,18 @@ do -- async object
400400
401401 function ltask .async ()
402402 local obj
403+ local function try_raise_error (type , msg , sz )
404+ local err = ltask .unpack_remove (msg , sz )
405+ if type == MESSAGE_ERROR then
406+ obj ._err = err
407+ end
408+ end
403409 local function wait_func (type , session , msg , sz )
404410 -- ignore type
405- ltask . unpack_remove ( msg , sz )
411+ try_raise_error ( type , msg , sz )
406412 while still_session (obj , session ) do
407413 type , session , msg , sz = yield_session ()
408- ltask . unpack_remove ( msg , sz )
414+ try_raise_error ( type , msg , sz )
409415 end
410416
411417 if obj ._wakeup then
@@ -435,6 +441,11 @@ do -- async object
435441 ltask .wait (self )
436442 end
437443 end
444+ local err = self ._err
445+ if err ~= nil then
446+ self ._err = nil
447+ rethrow_error (2 , err )
448+ end
438449 self ._wakeup = nil
439450 end
440451end
You can’t perform that action at this time.
0 commit comments