'extracts error message from response'

def error_reason(self, workername, response):

    for r in response:
        try:
            return r[workername].get('error', 'Unknown    reason')
        except KeyError:
            pass
    logger.error("Failed    to    extract    error    reason    from    '%s'", response)
    return 'Unknown    reason'
