Class XMPPException.XMPPErrorException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.jivesoftware.smack.XMPPException
org.jivesoftware.smack.XMPPException.XMPPErrorException
All Implemented Interfaces:
Serializable
Enclosing class:
XMPPException

public static class XMPPException.XMPPErrorException extends XMPPException
An exception caused by an XMPP error stanza response on the protocol level. You can examine the underlying StanzaError by calling getStanzaError().
See Also:
  • Constructor Details

    • XMPPErrorException

      public XMPPErrorException(Stanza stanza, StanzaError error)
      Creates a new XMPPErrorException with the XMPPError that was the root case of the exception.
      Parameters:
      stanza - stanza that contained the exception.
      error - the root cause of the exception.
    • XMPPErrorException

      public XMPPErrorException(Stanza stanza, StanzaError error, Stanza request)
      Creates a new XMPPErrorException with the XMPPError that was the root case of the exception.
      Parameters:
      request - the request which triggered the error.
      stanza - stanza that contained the exception.
      error - the root cause of the exception.
      Since:
      4.3.0
  • Method Details

    • getStanzaError

      public StanzaError getStanzaError()
      Returns the stanza error extension element associated with this exception.
      Returns:
      the stanza error extension element associated with this exception.
    • getStanza

      public Stanza getStanza()
      Gets the stanza associated with this exception.
      Returns:
      the stanza from which this exception was created or null if the exception is not from a stanza.
    • getRequest

      public Stanza getRequest()
      Get the request which triggered the error response causing this exception.
      Returns:
      the request or null.
      Since:
      4.3.0
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • ifHasErrorThenThrow

      public static void ifHasErrorThenThrow(Stanza packet) throws XMPPException.XMPPErrorException
      Throws:
      XMPPException.XMPPErrorException
    • ifHasErrorThenThrow

      public static void ifHasErrorThenThrow(Stanza packet, Stanza request) throws XMPPException.XMPPErrorException
      Throws:
      XMPPException.XMPPErrorException