I tried the following implementation
function do_work(f, jobs, results, args...)
while true
x = take!(jobs)
result = try
f(x, args...)
catch e
ErrorException(sprint(showerror, e))
end
put!(results, (x, result))
end
end
But this do_work will not catch any exception is f is simply not defined on the remote process. What I was asking is simply how to catch the undefined f error.