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'
extracts error message from response
dataset/ETHPy150Open mher/flower/flower/api/control.py/ControlHandler.error_reason