Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

improved worker error logging for communication with master

Pablo Hoffman215151dd8628
diff --git a/scrapy/branches/cluster-refactor/scrapy/contrib/pbcluster/worker/manager.py b/scrapy/branches/cluster-refactor/scrapy/contrib/pbcluster/worker/manager.py
index 4dc220170..901721e32 100644
--- a/scrapy/branches/cluster-refactor/scrapy/contrib/pbcluster/worker/manager.py
+++ b/scrapy/branches/cluster-refactor/scrapy/contrib/pbcluster/worker/manager.py
@@ -140,7 +140,9 @@ class ClusterWorker(pb.Root):
self._master = None
log.msg("Lost connection to master", log.ERROR)
else:
- deferred.addCallbacks(callback=lambda x: x, errback=lambda reason: log.msg(reason, log.ERROR))
+ def _eb(failure):
+ log.msg("Error received from ClusterMaster\n%s" % failure, level=log.ERROR)
+ deferred.addErrback(_eb)
def remote_set_master(self, master):
"""Set the master for this worker"""