def unwrap_error_with_hosts(error_obj):
    """Extracts original error from a wrapper listing hosts
    where the error occurred"""
    error_id = error_obj.get('id')
    description = error_obj.get('description')
    details = error_obj.get('details', {})
    nodes = []

    if error_id == 'errorOnNodes' and 'error' in details:
        error_id = details['error']['id']
        description = details['error']['description']
        nodes = details['hostnames']
        details = details['error'].get('details', {})

    return error_id, description, details, nodes