gearman-ruby
gearman-ruby copied to clipboard
How to print worker exceptions on worker stdout/stderr
My workers are raising exceptions and silently failing to finish. How can I have worker exceptions printed to stdout/stderr of the console running the worker?
@spiffytech
You should be able to do something like this:
class MyWorker < Gearman::Worker
on_work_exception do
# error handling logic
end
end
It occurs to me that it's not super useful that the exception isn't handed to the block as an argument. That would be an awesome contribution, but you may be able to get by in the meantime with $!
.