'Handle ServerErrors resulting from association requests.
@returns: If server replied with an C{unsupported-type} error,
return a tuple of supported C{association_type}, C{session_type}.
Otherwise logs the error and returns None.
@rtype: tuple or None'

def _extractSupportedAssociationType(self, server_error, endpoint, assoc_type):

    if ((server_error.error_code != 'unsupported-type') or server_error.message.isOpenID1()):
        oidutil.log(('Server    error    when    requesting    an    association    from    %r:    %s' % (endpoint.server_url, server_error.error_text)))
        return None
    oidutil.log(('Unsupported    association    type    %s:    %s' % (assoc_type, server_error.error_text)))
    assoc_type = server_error.message.getArg(OPENID_NS, 'assoc_type')
    session_type = server_error.message.getArg(OPENID_NS, 'session_type')
    if ((assoc_type is None) or (session_type is None)):
        oidutil.log('Server    responded    with    unsupported    association    session    but    did    not    supply    a    fallback.')
        return None
    elif (not self.negotiator.isAllowed(assoc_type, session_type)):
        fmt = 'Server    sent    unsupported    session/association    type:    session_type=%s,    assoc_type=%s'
        oidutil.log((fmt % (session_type, assoc_type)))
        return None
    else:
        return (assoc_type, session_type)
