code: def from_exception(cls, exc):
          
          result = cls(
              condition=exc.condition,
              type_=exc.TYPE,
              text=exc.text
          )
          result.application_condition = exc.application_defined_condition
          return result
docs: Construct a new :class:`Error` payload from the attributes of the
          exception.
  
          :param exc: The exception to convert
          :type exc: :class:`aioxmpp.errors.XMPPError`
          :result: Newly constructed error payload
          :rtype: :class:`Error`
  
          .. versionchanged:: 0.10
  
              The :attr:`aioxmpp.XMPPError.application_defined_condition` is now
              taken over into the result.