def get_first_failure(responses):
    """Find failed response from list of responses"""
    for response in responses:
        if response['code'] > 399:
            return response
    raise KeyError