from scrapy import signals
from scrapy.xlib.pydispatch import dispatcher


class FailLogger(object):

    def __init__(self):
        """ 
    Attach appropriate handlers to the signals
    """
dispatcher.connect(self.spider_error, signal=signals.spider_error)

def spider_error(self, failure, response, spider):
    print('Error on {0}, traceback: {1}'.format(response.url, failure.
        getTraceback()))
how to process all kinds of exception in a scrapy project, in errback and callback?