def _error_matches_criteria(error, criteria):
    """
    Check if an error matches a set of criteria.

    Args:
        error:
            The error to check.
        criteria:
            A list of key value pairs to check for in the error.

    Returns:
        A boolean indicating if the provided error matches the given
        criteria.
    """
    for key, value in criteria:
        if error.get(key) != value:
            return False

    return True