'If kill_on_failure, print this error and die,
otherwise, queue the error and accumulate all the items
that triggered the same error.'

def failure(self, full_error, item=None, what_failed='', fatal=False):

    if self.debug:
        errmsg = str(full_error)
    else:
        errmsg = str(full_error).split('Traceback')[0].rstrip('\n')
    if (self.kill_on_failure or fatal):
        print >>sys.stderr, ('%s\n                %s' % (what_failed, errmsg))
        sys.exit(1)
    if (item and (item in errmsg)):
        errmsg = errmsg.replace(item, FAIL_TAG)
    if self.failed.has_key(what_failed):
        self.failed[what_failed].setdefault(errmsg, set()).add(item)
    else:
        self.failed[what_failed] = {errmsg: set([item])}
