'Create an :class:`~sleekxmpp.stanza.iq.Iq` stanza of type ``\'error\'``.
:param id: An ideally unique ID value. May use :meth:`new_id()`.
:param type: The type of the error, such as ``\'cancel\'`` or
``\'modify\'``. Defaults to ``\'cancel\'``.
:param condition: The error condition. Defaults to
``\'feature-not-implemented\'``.
:param text: A message describing the cause of the error.
:param ito: The destination :class:`~sleekxmpp.xmlstream.jid.JID`
for this stanza.
:param ifrom: The ``\'from\'`` :class:`~sleekxmpp.xmlstream.jid.JID`
to use for this stanza.
:param iq: Optionally use an existing stanza instead
of generating a new one.'

def make_iq_error(self, id, type=u'cancel', condition=u'feature-not-implemented', text=None, ito=None, ifrom=None, iq=None):

    if (not iq):
        iq = self.Iq()
    iq[u'id'] = id
    iq[u'error'][u'type'] = type
    iq[u'error'][u'condition'] = condition
    iq[u'error'][u'text'] = text
    if ito:
        iq[u'to'] = ito
    if ifrom:
        iq[u'from'] = ifrom
    return iq
