Clean up some of the logic in ScaleoutTaskQueue.
Only raise error handler if it's set.