'This method handles everything that needs to be done when one step
in the session has failed and thus no data can be obtained.'

def failed(self, msg=None):

    self._is_failed = True
    if self.scraper:
        self.scraper.stop()
        self.scraper = None
    if self.result_deferred:
        result_msg = ('UDP    tracker    failed    for    url    %s' % self._tracker_url)
        if msg:
            result_msg += ('    (error:    %s)' % unicode(msg, errors='replace'))
        self.result_deferred.errback(ValueError(result_msg))
