def errorString(node, error):
    """
    Format error messages for node errors returned by checkLinkoStructure.

    inputs:

    node - the node for the error.
    error - a (backset, foreset) tuple, where backset is the set of
    missing backlinks and foreset is the set of missing forelinks.

    returns: string

    string - the error string message.
    """

    back, fore = error[0], error[1]

    if len(back) == 0:
        back = 'None'

    if len(fore) == 0:
        fore = 'None'
    
    return ('Node {0}: missing backlinks {1},'
            ' missing forelinks {2}').format(node, back, fore)