code: def to_exception(self):
          
          if hasattr(self.application_condition, "to_exception"):
              result = self.application_condition.to_exception(self.type_)
              if isinstance(result, Exception):
                  return result
  
          return self.EXCEPTION_CLS_MAP[self.type_](
              condition=self.condition_obj,
              text=self.text,
              application_defined_condition=self.application_condition,
          )
docs: Convert the error payload to a :class:`~aioxmpp.errors.XMPPError`
          subclass.
  
          :result: Newly constructed exception
          :rtype: :class:`aioxmpp.errors.XMPPError`
  
          The exact type of the result depends on the :attr:`type_` (see
          :class:`~aioxmpp.errors.XMPPError` about the existing subclasses).
  
          The :attr:`condition_obj`, :attr:`text` and
          :attr:`application_condition` are transferred to the respective
          attributes of the :class:`~aioxmpp.errors.XMPPError`.