def failure_message_from_response(response):
    """
    Given EMR response, returns a descriptive error message
    """
    fail_details = response['Step']['Status'].get('FailureDetails')
    if fail_details:
        return 'for reason {} with message {} and log file {}'.format(
            fail_details.get('Reason'), fail_details.get('Message'),
            fail_details.get('LogFile'))
