File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -70,9 +70,16 @@ function consume(ttask::TapedTask)
7070 val = try
7171 take! (ttask. produce_ch)
7272 catch e
73- # return nothing to indicate the finish of the task
74- isa (e, InvalidStateException) ? nothing : rethrow ()
73+ isa (e, InvalidStateException) || rethrow ()
74+ istaskfailed (ttask. task) && throw (ttask. task. exception)
75+ # TODO : we return nothing to indicate the end of a task,
76+ # remove this when AdvancedPS is udpated.
77+ istaskdone (ttask. task) && return nothing
7578 end
79+
80+ # yield to let the task resume, this is necessary when there's
81+ # an exception is thrown in the task, it gives the task the chance
82+ # to rethow the exception and set its proper status:
7683 yield ()
7784 isa (val, TapedTaskException) && throw (val. exc)
7885 return val
You can’t perform that action at this time.
0 commit comments